From 01ef9ca979cb14a6f5a76fcdb44946a367b2769d Mon Sep 17 00:00:00 2001 From: Andreas Rossberg Date: Sat, 20 Jan 2024 14:22:50 +0100 Subject: [PATCH] Minor syntax refactoring --- spectec/src/backend-latex/render.ml | 24 +- spectec/src/el/ast.ml | 17 +- spectec/src/el/convert.ml | 26 +- spectec/src/el/convert.mli | 5 + spectec/src/el/eq.ml | 4 +- spectec/src/el/free.ml | 23 +- spectec/src/el/print.ml | 16 +- spectec/src/el/subst.ml | 14 +- spectec/src/el/subst.mli | 1 + spectec/src/frontend/elab.ml | 45 +- spectec/src/frontend/multiplicity.ml | 8 +- spectec/src/frontend/parser.mly | 27 +- spectec/src/il/eq.ml | 14 + spectec/src/il/eq.mli | 1 + spectec/src/util/lib.ml | 12 + spectec/src/util/lib.mli | 2 + spectec/test-frontend/TEST.md | 2950 ++-- spectec/test-latex/TEST.md | 145 + spectec/test-middlend/TEST.md | 20347 +++++++++++++------------ spectec/test-prose/TEST.md | 215 +- 20 files changed, 12259 insertions(+), 11637 deletions(-) diff --git a/spectec/src/backend-latex/render.ml b/spectec/src/backend-latex/render.ml index 2334ed71b4..ca4e72f249 100644 --- a/spectec/src/backend-latex/render.ml +++ b/spectec/src/backend-latex/render.ml @@ -179,7 +179,7 @@ let rec expand_iter args iter = and expand_exp args e = (match e.it with - | AtomE _ | BoolE _ | NatE _ | HexE _ | CharE _ | TextE _ | EpsE -> e.it + | AtomE _ | BoolE _ | NatE _ | TextE _ | EpsE -> e.it | VarE (id, args') -> VarE (id, List.map (expand_arg args) args') | UnE (op, e) -> UnE (op, expand_exp args e) | BinE (e1, op, e2) -> @@ -496,9 +496,9 @@ and render_typ env t = "\\begin{array}[t]{@{}l@{}l@{}}\n" ^ concat_map_nl ",\\; " "\\\\\n " (render_typfield env) tfs ^ " \\;\\}" ^ "\\end{array}" - | CaseT (dots1, ids, tcases, dots2) -> + | CaseT (dots1, ts, tcases, dots2) -> altern_map_nl " ~|~ " " \\\\ &&|&\n" Fun.id - (render_dots dots1 @ map_nl_list (render_synid env) ids @ + (render_dots dots1 @ map_nl_list (render_typ env) ts @ map_nl_list (render_typcase env) tcases @ render_dots dots2) | RangeT tes -> altern_map_nl " ~|~ " "\\\\ &&|&\n" (render_typenum env) tes @@ -532,14 +532,14 @@ and render_exp env e = | VarE (id, args) -> render_apply render_varid render_exp env env.show_syn id args | BoolE b -> render_atom env (Atom (string_of_bool b)) - | NatE n -> string_of_int n - | HexE n -> + | NatE (DecOp, n) -> string_of_int n + | NatE (HexOp, n) -> let fmt : (_, _, _) format = if n < 0x100 then "%02X" else if n < 0x10000 then "%04X" else "%X" in "\\mathtt{0x" ^ Printf.sprintf fmt n ^ "}" - | CharE n -> + | NatE (CharOp, n) -> let fmt : (_, _, _) format = if n < 0x100 then "%02X" else if n < 0x10000 then "%04X" else @@ -678,14 +678,14 @@ and render_sym env g = match g.it with | VarG (id, args) -> render_apply render_gramid render_exp_as_sym env env.show_gram id args - | NatG n -> string_of_int n - | HexG n -> + | NatG (DecOp, n) -> string_of_int n + | NatG (HexOp, n) -> let fmt : (_, _, _) format = if n < 0x100 then "%02X" else if n < 0x10000 then "%04X" else "%X" in "\\mathtt{0x" ^ Printf.sprintf fmt n ^ "}" - | CharG n -> + | NatG (CharOp, n) -> let fmt : (_, _, _) format = if n < 0x100 then "%02X" else if n < 0x10000 then "%04X" else @@ -838,9 +838,9 @@ let render_reddef env d = let render_funcdef env d = match d.it with - | DefD (id1, e1, e2, prems) -> - render_exp env (CallE (id1, e1) $ d.at) ^ " &=& " ^ - render_exp env e2 ^ render_conditions env "&&&" prems + | DefD (id1, args, e, prems) -> + render_exp env (CallE (id1, args) $ d.at) ^ " &=& " ^ + render_exp env e ^ render_conditions env "&&&" prems | _ -> failwith "render_funcdef" let rec render_sep_defs ?(sep = " \\\\\n") ?(br = " \\\\[0.8ex]\n") f = function diff --git a/spectec/src/el/ast.ml b/spectec/src/el/ast.ml index 00fabe737f..ffa8971df6 100644 --- a/spectec/src/el/ast.ml +++ b/spectec/src/el/ast.ml @@ -81,7 +81,7 @@ and typ' = | IterT of typ * iter (* typ iter *) (* The forms below are only allowed in type definitions *) | StrT of typfield nl_list (* `{` list(typfield,`,`') `}` *) - | CaseT of dots * id nl_list * typcase nl_list * dots (* `|` list(`...`|varid|typcase, `|`) *) + | CaseT of dots * typ nl_list * typcase nl_list * dots (* `|` list(`...`|typ|typcase, `|`) *) | RangeT of typenum nl_list (* exp `|` `...` `|` exp *) | AtomT of atom (* atom *) | SeqT of typ list (* `eps` / typ typ *) @@ -95,6 +95,11 @@ and typenum = exp * exp option (* exp (`|` exp (`|` `...` `|` e (* Expressions *) +and natop = + | DecOp (* n *) + | HexOp (* 0xhex *) + | CharOp (* U+hex *) + and unop = | NotOp (* `~` *) | PlusOp (* `+` *) @@ -124,9 +129,7 @@ and exp' = | VarE of id * arg list (* varid *) | AtomE of atom (* atom *) | BoolE of bool (* bool *) - | NatE of nat (* nat *) - | HexE of nat (* 0xhex *) - | CharE of nat (* 0uhex *) + | NatE of natop * nat (* nat *) | TextE of text (* text *) | UnE of unop * exp (* unop exp *) | BinE of exp * binop * exp (* exp binop exp *) @@ -168,9 +171,7 @@ and path' = and sym = sym' phrase and sym' = | VarG of id * arg list (* gramid (`(` arg,* `)`)? *) - | NatG of int (* nat *) - | HexG of int (* 0xhex *) - | CharG of int (* U+hex *) + | NatG of natop * int (* nat *) | TextG of string (* `"`text`"` *) | EpsG (* `eps` *) | SeqG of sym nl_list (* sym sym *) @@ -211,7 +212,7 @@ and def' = | RuleD of id * id * exp * premise nl_list (* `rule` relid ruleid? `:` exp (`--` premise)* *) | VarD of id * typ * hint list (* `var` varid `:` typ *) | DecD of id * param list * typ * hint list (* `def` `$` defid params `:` typ hint* *) - | DefD of id * arg list * exp * premise nl_list (* `def` `$` defid exp? `=` exp (`--` premise)* *) + | DefD of id * arg list * exp * premise nl_list (* `def` `$` defid args `=` exp (`--` premise)* *) | SepD (* separator *) | HintD of hintdef diff --git a/spectec/src/el/convert.ml b/spectec/src/el/convert.ml index 98451e19db..419afad227 100644 --- a/spectec/src/el/convert.ml +++ b/spectec/src/el/convert.ml @@ -4,9 +4,18 @@ open Ast let filter_nl xs = List.filter_map (function Nl -> None | Elem x -> Some x) xs +let find_nl_list f xs = List.find_opt f (filter_nl xs) let iter_nl_list f xs = List.iter f (filter_nl xs) let map_filter_nl_list f xs = List.map f (filter_nl xs) let map_nl_list f xs = List.map (function Nl -> Nl | Elem x -> Elem (f x)) xs +let concat_map_nl_list f xs = List.concat_map (function Nl -> [Nl] | Elem x -> f x) xs + + +let strip_var_suffix id = + match String.index_opt id.it '_', String.index_opt id.it '\'' with + | None, None -> id + | None, Some n | Some n, None -> String.sub id.it 0 n $ id.at + | Some n1, Some n2 -> String.sub id.it 0 (min n1 n2) $ id.at let arg_of_exp e = @@ -58,7 +67,7 @@ let rec exp_of_typ t = | SeqT ts -> SeqE (List.map exp_of_typ ts) | InfixT (t1, atom, t2) -> InfixE (exp_of_typ t1, atom, exp_of_typ t2) | BrackT (l, t1, r) -> BrackE (l, exp_of_typ t1, r) - | _ -> Source.error t.at "syntax" "malformed expression" + | CaseT _ | RangeT _ -> Source.error t.at "syntax" "malformed expression" ) $ t.at and expfield_of_typfield (atom, (t, _prems), _) = @@ -68,9 +77,7 @@ and expfield_of_typfield (atom, (t, _prems), _) = let rec sym_of_exp e = (match e.it with | VarE (id, args) -> VarG (id, args) - | NatE n -> NatG n - | HexE n -> HexG n - | CharE c -> CharG c + | NatE (op, n) -> NatG (op, n) | TextE s -> TextG s | EpsE -> EpsG | SeqE es -> SeqG (List.map (fun e -> Elem (sym_of_exp e)) es) @@ -84,9 +91,7 @@ let rec sym_of_exp e = let rec exp_of_sym g = (match g.it with | VarG (id, args) -> VarE (id, args) - | NatG n -> NatE n - | HexG n -> HexE n - | CharG n -> CharE n + | NatG (op, n) -> NatE (op, n) | TextG t -> TextE t | EpsG -> EpsE | SeqG gs -> SeqE (map_filter_nl_list exp_of_sym gs) @@ -112,3 +117,10 @@ let param_of_arg a = GramP (id, typ_of_exp (exp_of_sym g)) | _ -> Source.error a.at "syntax" "malformed grammar" ) $ a.at + +let arg_of_param p = + (match p.it with + | ExpP (id, _t) -> ExpA (VarE (id, []) $ id.at) + | SynP id -> SynA (VarT (id, []) $ id.at) + | GramP (id, _t) -> GramA (VarG (id, []) $ id.at) + ) |> ref $ p.at diff --git a/spectec/src/el/convert.mli b/spectec/src/el/convert.mli index 658e6222d0..b15c377bf7 100644 --- a/spectec/src/el/convert.mli +++ b/spectec/src/el/convert.mli @@ -1,8 +1,10 @@ open Ast val filter_nl : 'a nl_list -> 'a list +val find_nl_list : ('a -> bool) -> 'a nl_list -> 'a option val iter_nl_list : ('a -> unit) -> 'a nl_list -> unit val map_nl_list : ('a -> 'b) -> 'a nl_list -> 'b nl_list +val concat_map_nl_list : ('a -> 'b nl_list) -> 'a nl_list -> 'b nl_list val map_filter_nl_list : ('a -> 'b) -> 'a nl_list -> 'b list val typ_of_exp : exp -> typ (* raises Source.Error *) @@ -12,3 +14,6 @@ val exp_of_sym : sym -> exp (* raises Source.Error *) val arg_of_exp : exp -> arg (* raises Source.Error *) val exp_of_arg : arg -> exp (* raises Source.Error *) val param_of_arg : arg -> param (* raises Source.Error *) +val arg_of_param : param -> arg (* raises Source.Error *) + +val strip_var_suffix : id -> id diff --git a/spectec/src/el/eq.ml b/spectec/src/el/eq.ml index 90ce76393b..3aa8f35390 100644 --- a/spectec/src/el/eq.ml +++ b/spectec/src/el/eq.ml @@ -44,8 +44,8 @@ and eq_typ t1 t2 = | IterT (t11, iter1), IterT (t21, iter2) -> eq_typ t11 t21 && eq_iter iter1 iter2 | StrT tfs1, StrT tfs2 -> eq_nl_list eq_typfield tfs1 tfs2 - | CaseT (dots11, ids1, tcs1, dots12), CaseT (dots21, ids2, tcs2, dots22) -> - dots11 = dots21 && eq_nl_list (=) ids1 ids2 && + | CaseT (dots11, ts1, tcs1, dots12), CaseT (dots21, ts2, tcs2, dots22) -> + dots11 = dots21 && eq_nl_list eq_typ ts1 ts2 && eq_nl_list eq_typcase tcs1 tcs2 && dots12 = dots22 | RangeT tes1, RangeT tes2 -> eq_nl_list eq_typenum tes1 tes2 | SeqT ts1, SeqT ts2 -> eq_list eq_typ ts1 ts2 diff --git a/spectec/src/el/free.ml b/spectec/src/el/free.ml index 7c9c287dc1..681eb7f653 100644 --- a/spectec/src/el/free.ml +++ b/spectec/src/el/free.ml @@ -80,8 +80,8 @@ and free_typ t = | TupT ts -> free_list free_typ ts | IterT (t1, iter) -> union (free_typ t1) (free_iter iter) | StrT tfs -> free_nl_list free_typfield tfs - | CaseT (_, ids, tcs, _) -> - union (free_nl_list free_synid ids) (free_nl_list free_typcase tcs) + | CaseT (_, ts, tcs, _) -> + union (free_nl_list free_typ ts) (free_nl_list free_typcase tcs) | RangeT tes -> free_nl_list free_typenum tes | AtomT _ -> empty | SeqT ts -> free_list free_typ ts @@ -101,7 +101,7 @@ and free_typenum (e, eo) = and free_exp e = match e.it with | VarE (id, args) -> union (free_varid id) (free_list free_arg args) - | AtomE _ | BoolE _ | NatE _ | HexE _ | CharE _ | TextE _ | EpsE | HoleE _ -> + | AtomE _ | BoolE _ | NatE _ | TextE _ | EpsE | HoleE _ -> empty | UnE (_, e1) | DotE (e1, _) | LenE e1 | ParenE (e1, _) | BrackE (_, e1, _) -> free_exp e1 @@ -133,7 +133,7 @@ and free_path p = and bound_exp e = match e.it with | CmpE (e1, EqOp, e2) -> union (pat_exp e1) (pat_exp e2) - | VarE _ | AtomE _ | BoolE _ | NatE _ | HexE _ | CharE _ | TextE _ + | VarE _ | AtomE _ | BoolE _ | NatE _ | TextE _ | SizeE _ | EpsE | HoleE _ -> empty | UnE (_, e1) | DotE (e1, _) | LenE e1 | ParenE (e1, _) | BrackE (_, e1, _) -> bound_exp e1 @@ -229,7 +229,7 @@ and bound_prem prem = and free_sym g = match g.it with | VarG (id, args) -> union (free_gramid id) (free_list free_arg args) - | NatG _ | HexG _ | CharG _ | TextG _ | EpsG -> empty + | NatG _ | TextG _ | EpsG -> empty | SeqG gs | AltG gs -> free_nl_list free_sym gs | RangeG (g1, g2) -> union (free_sym g1) (free_sym g2) | ParenG g1 -> free_sym g1 @@ -267,24 +267,27 @@ let bound_param p = | SynP id -> bound_synid id | GramP (id, _) -> bound_gramid id +let free_args args = free_list free_arg args +let free_params ps = free_list free_param ps +let bound_args args = free_list pat_arg args let bound_params ps = free_list bound_param ps let free_def d = match d.it with | SynD (_id1, _id2, ps, t, _hints) -> - union (free_list free_param ps) (diff (free_typ t) (bound_params ps)) + union (free_params ps) (diff (free_typ t) (bound_params ps)) | GramD (_id1, _id2, ps, t, gram, _hints) -> union - (free_list free_param ps) + (free_params ps) (diff (union (free_typ t) (free_gram gram)) (bound_params ps)) | VarD _ | SepD -> empty | RelD (_id, t, _hints) -> free_typ t | RuleD (id1, _id2, e, prems) -> union (free_relid id1) (union (free_exp e) (free_nl_list free_prem prems)) | DecD (_id, ps, t, _hints) -> - union (free_list free_param ps) (diff (free_typ t) (bound_params ps)) + union (free_params ps) (diff (free_typ t) (bound_params ps)) | DefD (id, args, e, prems) -> union - (union (free_defid id) (free_list free_arg args)) - (union (free_exp e) (free_nl_list free_prem prems)) + (union (free_defid id) (free_args args)) + (diff (union (free_exp e) (free_nl_list free_prem prems)) (bound_args args)) | HintD _ -> empty diff --git a/spectec/src/el/print.ml b/spectec/src/el/print.ml index d1c6e14879..0cf62877a7 100644 --- a/spectec/src/el/print.ml +++ b/spectec/src/el/print.ml @@ -109,9 +109,9 @@ and string_of_typ t = | IterT (t1, iter) -> string_of_typ t1 ^ string_of_iter iter | StrT tfs -> "{" ^ concat ", " (map_filter_nl_list string_of_typfield tfs) ^ "}" - | CaseT (dots1, ids, tcases, dots2) -> + | CaseT (dots1, ts, tcases, dots2) -> "\n | " ^ concat "\n | " - (strings_of_dots dots1 @ map_filter_nl_list it ids @ + (strings_of_dots dots1 @ map_filter_nl_list string_of_typ ts @ map_filter_nl_list string_of_typcase tcases @ strings_of_dots dots2) | RangeT tes -> concat " | " (map_filter_nl_list string_of_typenum tes) | AtomT atom -> string_of_atom atom @@ -146,9 +146,9 @@ and string_of_exp e = | VarE (id, args) -> id.it ^ string_of_args args | AtomE atom -> string_of_atom atom | BoolE b -> string_of_bool b - | NatE n -> string_of_int n - | HexE n -> Printf.sprintf "0x%X" n - | CharE n -> Printf.sprintf "U+%X" n + | NatE (DecOp, n) -> string_of_int n + | NatE (HexOp, n) -> Printf.sprintf "0x%X" n + | NatE (CharOp, n) -> Printf.sprintf "U+%X" n | TextE t -> "\"" ^ String.escaped t ^ "\"" | UnE (op, e2) -> string_of_unop op ^ " " ^ string_of_exp e2 | BinE (e1, op, e2) -> @@ -222,9 +222,9 @@ and string_of_prem prem = and string_of_sym g = match g.it with | VarG (id, args) -> id.it ^ string_of_args args - | NatG n -> string_of_int n - | HexG n -> Printf.sprintf "0x%X" n - | CharG n -> Printf.sprintf "U+%X" n + | NatG (DecOp, n) -> string_of_int n + | NatG (HexOp, n) -> Printf.sprintf "0x%X" n + | NatG (CharOp, n) -> Printf.sprintf "U+%X" n | TextG t -> "\"" ^ String.escaped t ^ "\"" | EpsG -> "eps" | SeqG gs -> "{" ^ concat " " (map_filter_nl_list string_of_sym gs) ^ "}" diff --git a/spectec/src/el/subst.ml b/spectec/src/el/subst.ml index eea2326ca2..ea3c5856e1 100644 --- a/spectec/src/el/subst.ml +++ b/spectec/src/el/subst.ml @@ -33,12 +33,6 @@ let subst_varid s id = | Some {it = VarE (id', []); _} -> id' | Some _ -> raise (Invalid_argument "subst_varid") -let subst_synid s id = - match Map.find_opt id.it s.synid with - | None -> id - | Some {it = VarT (id', []); _} -> id' - | Some _ -> raise (Invalid_argument "subst_synid") - let subst_gramid s id = match Map.find_opt id.it s.gramid with | None -> id @@ -69,8 +63,8 @@ and subst_typ s t = | TupT ts -> TupT (subst_list subst_typ s ts) | IterT (t1, iter) -> IterT (subst_typ s t1, subst_iter s iter) | StrT tfs -> StrT (subst_nl_list subst_typfield s tfs) - | CaseT (dots1, ids, tcs, dots2) -> - CaseT (dots1, subst_nl_list subst_synid s ids, + | CaseT (dots1, ts, tcs, dots2) -> + CaseT (dots1, subst_nl_list subst_typ s ts, subst_nl_list subst_typcase s tcs, dots2) | RangeT tes -> RangeT (subst_nl_list subst_typenum s tes) | SeqT ts -> SeqT (subst_list subst_typ s ts) @@ -96,7 +90,7 @@ and subst_exp s e = | Some e' -> assert (args = []); e' (* We do not support higher-order substitutions yet *) ).it - | AtomE _ | BoolE _ | NatE _ | HexE _ | CharE _ | TextE _ -> e.it + | AtomE _ | BoolE _ | NatE _ | TextE _ -> e.it | UnE (op, e1) -> UnE (op, subst_exp s e1) | BinE (e1, op, e2) -> BinE (subst_exp s e1, op, subst_exp s e2) | CmpE (e1, op, e2) -> CmpE (subst_exp s e1, op, subst_exp s e2) @@ -156,7 +150,7 @@ and subst_sym s g = | Some g' -> assert (args = []); g' (* We do not support higher-order substitutions yet *) ).it - | NatG _ | HexG _ | CharG _ | TextG _ -> g.it + | NatG _ | TextG _ -> g.it | EpsG -> EpsG | SeqG gs -> SeqG (subst_nl_list subst_sym s gs) | AltG gs -> AltG (subst_nl_list subst_sym s gs) diff --git a/spectec/src/el/subst.mli b/spectec/src/el/subst.mli index fb0dac6b72..c2eabefc9b 100644 --- a/spectec/src/el/subst.mli +++ b/spectec/src/el/subst.mli @@ -18,5 +18,6 @@ val subst_typ : subst -> typ -> typ val subst_exp : subst -> exp -> exp val subst_path : subst -> path -> path val subst_prem : subst -> premise -> premise +val subst_sym : subst -> sym -> sym val subst_arg : subst -> arg -> arg val subst_param : subst -> param -> param diff --git a/spectec/src/frontend/elab.ml b/spectec/src/frontend/elab.ml index 7d7213517e..fa5c64b7b4 100644 --- a/spectec/src/frontend/elab.ml +++ b/spectec/src/frontend/elab.ml @@ -140,14 +140,6 @@ let find_case cases atom at t = | None -> error_atom at atom t "unknown case" -let rec prefix_id id = prefix_id' id.it $ id.at -and prefix_id' id = - match String.index_opt id '_', String.index_opt id '\'' with - | None, None -> id - | None, Some n | Some n, None -> String.sub id 0 n - | Some n1, Some n2 -> String.sub id 0 (min n1 n2) - - (* Type Accessors *) let rec arg_subst s ps args = @@ -250,15 +242,15 @@ let as_struct_typ phrase env dir t at : typfield list = let rec as_variant_typid' phrase env id args at : typcase list * dots = match as_defined_typid' env id args at with | VarT (id', args'), `Alias -> as_variant_typid' phrase env id' args' at - | CaseT (_dots1, ids, cases, dots2), _ -> - let casess = map_filter_nl_list (fun id -> as_variant_typid "" env id []) ids in + | CaseT (_dots1, ts, cases, dots2), _ -> + let casess = map_filter_nl_list (fun t -> as_variant_typ "" env Infer t at) ts in List.concat (filter_nl cases :: List.map fst casess), dots2 | _ -> error_dir_typ id.at phrase Infer (VarT (id, args) $ id.at) "| ..." and as_variant_typid phrase env id args : typcase list * dots = as_variant_typid' phrase env id args id.at -let as_variant_typ phrase env dir t at : typcase list * dots = +and as_variant_typ phrase env dir t at : typcase list * dots = match expand_singular env t with | VarT (id, args) -> as_variant_typid' phrase env id args at | _ -> error_dir_typ at phrase dir t "| ..." @@ -460,7 +452,7 @@ let rec elab_iter env iter : Il.iter = | List1 -> Il.List1 | ListN (e, id_opt) -> Option.iter (fun id -> - let t = find "variable" env.vars (prefix_id id) in + let t = find "variable" env.vars (strip_var_suffix id) in if not (equiv_typ env t (NumT NatT $ id.at)) then error_typ e.at "iteration index" (NumT NatT $ id.at) ) id_opt; @@ -495,10 +487,10 @@ and elab_typ_definition env id t : Il.deftyp = let tfs' = filter_nl tfs in check_atoms "record" "field" tfs' t.at; Il.StructT (map_filter_nl_list (elab_typfield env) tfs) - | CaseT (dots1, ids, cases, _dots2) -> + | CaseT (dots1, ts, cases, _dots2) -> let cases0 = if dots1 = Dots then fst (as_variant_typid "own type" env id []) else [] in - let casess = map_filter_nl_list (fun id -> as_variant_typid "parent type" env id []) ids in + let casess = map_filter_nl_list (fun t -> as_variant_typ "parent type" env Infer t t.at) ts in let cases' = List.flatten (cases0 :: List.map fst casess @ [filter_nl cases]) in let tcs' = List.map (elab_typcase env t.at) cases' in @@ -612,13 +604,13 @@ and infer_exp' env e : Il.exp' * typ = | VarE (id, args) -> if args <> [] then Source.error e.at "syntax" "malformed expression"; - let t = find "variable" env.vars (prefix_id id) in + let t = find "variable" env.vars (strip_var_suffix id) in Il.VarE id, t | AtomE _ -> error e.at "cannot infer type of atom" | BoolE b -> Il.BoolE b, BoolT $ e.at - | NatE n | HexE n | CharE n -> + | NatE (_op, n) -> Il.NatE n, NumT NatT $ e.at | TextE s -> Il.TextE s, TextT $ e.at @@ -743,9 +735,9 @@ and elab_exp' env e t : Il.exp' = (string_of_region e.at) (string_of_exp e) (string_of_typ t); *) match e.it with - | VarE (id, []) when not (Map.mem (prefix_id id).it env.vars) -> + | VarE (id, []) when not (Map.mem (strip_var_suffix id).it env.vars) -> (* Infer type of variable *) - env.vars <- bind "variable" env.vars (prefix_id id) t; + env.vars <- bind "variable" env.vars (strip_var_suffix id) t; Il.VarE id | VarE _ -> let e', t' = infer_exp env e in @@ -753,7 +745,7 @@ and elab_exp' env e t : Il.exp' = | BoolE _ -> let e', t' = infer_exp env e in cast_exp' "boolean" env e' t' t - | NatE _ | HexE _ | CharE _ -> + | NatE _ -> let e', t' = infer_exp env e in cast_exp' "number" env e' t' t | TextE _ -> @@ -1142,6 +1134,12 @@ and cast_exp' phrase env e' t1 t2 : Il.exp' = Il.SubE (e', elab_typ env t1, elab_typ env t2) else match expand env t2 with + | RangeT _ -> + if sub_typ env t1 (NumT IntT $ t1.at) then + (* TODO: can't generally prove it's in range *) + e'.it + else + error e'.at ("literal not in range of type `" ^ string_of_typ t2 ^ "`") | IterT (t21, Opt) -> Il.OptE (Some (cast_exp phrase env e' t1 t21)) | IterT (t21, (List | List1)) -> @@ -1202,7 +1200,7 @@ and elab_sym env g : typ * env = let ps, t, _gram = find "grammar" env.syms id in let _es', s = elab_args env ps args g.at in Subst.subst_typ s t, env - | NatG _ | HexG _ | CharG _ -> NumT NatT $ g.at, env + | NatG _ -> NumT NatT $ g.at, env | TextG _ -> TextT $ g.at, env | EpsG -> TupT [] $ g.at, env | SeqG gs -> @@ -1260,7 +1258,7 @@ and elab_gram env gram t = and make_binds env free dims at : Il.binds = List.map (fun id' -> let id = id' $ at in - let t = find "variable" env.vars (prefix_id id) in + let t = find "variable" env.vars (strip_var_suffix id) in let t' = elab_typ env t in let ctx = List.map (elab_iter env) (Multiplicity.Env.find id.it dims) in (id, t', ctx) @@ -1476,13 +1474,14 @@ let elab_def env d : Il.def list = let free = (Free.free_def d).Free.varid in let binds' = make_binds env' free dims d.at in let rule' = Il.RuleD (id2, binds', mixop, tup_exp' es' e.at, prems') $ d.at in - env.rels <- rebind "relation" env.rels id1 (t, rule'::rules'); + env.rels <- rebind "relation" env.rels id1 (t, rules' @ [rule']); [] | VarD (id, t, _hints) -> let _t' = elab_typ env t in env.vars <- rebind "variable" env.vars id t; [] | DecD (id, ps, t, hints) -> +Printf.printf "[elab def] %s\n%!" (El.Print.string_of_def d); let ts', env' = elab_params (local_env env) ps in let t' = elab_typ env' t in env.defs <- bind "function" env.defs id (ps, t, []); @@ -1524,7 +1523,7 @@ let elab_def env d : Il.def list = in let binds' = make_binds env' free dims d.at in let clause' = Il.DefD (binds', e1', e2', prems') $ d.at in - env.defs <- rebind "definition" env.defs id (ps, t, clause'::clauses'); + env.defs <- rebind "definition" env.defs id (ps, t, clauses' @ [clause']); [] | SepD -> [] diff --git a/spectec/src/frontend/multiplicity.ml b/spectec/src/frontend/multiplicity.ml index 252fff90cd..1554974b7c 100644 --- a/spectec/src/frontend/multiplicity.ml +++ b/spectec/src/frontend/multiplicity.ml @@ -99,8 +99,8 @@ and check_typ env ctx t = check_typ env ctx tI; iter_nl_list (check_prem env ctx) prems ) tfs - | CaseT (_, ids, tcs, _) -> - iter_nl_list (check_synid env ctx) ids; + | CaseT (_, ts, tcs, _) -> + iter_nl_list (check_typ env ctx) ts; iter_nl_list (fun (_, (tI, prems), _) -> check_typ env ctx tI; iter_nl_list (check_prem env ctx) prems @@ -122,8 +122,6 @@ and check_exp env ctx e = | AtomE _ | BoolE _ | NatE _ - | HexE _ - | CharE _ | TextE _ | SizeE _ | EpsE @@ -179,8 +177,6 @@ and check_sym env ctx g = check_gramid env ctx id; List.iter (check_arg env ctx) args | NatG _ - | HexG _ - | CharG _ | TextG _ | EpsG -> () | SeqG gs diff --git a/spectec/src/frontend/parser.mly b/spectec/src/frontend/parser.mly index e3025002d7..1a1b0e6bc6 100644 --- a/spectec/src/frontend/parser.mly +++ b/spectec/src/frontend/parser.mly @@ -50,18 +50,13 @@ module VarSet = Set.Make(String) let atom_vars = ref VarSet.empty let scopes = ref [] -let strip_ticks id = - let i = ref (String.length id) in - while !i > 0 && id.[!i - 1] = '\'' do decr i done; - String.sub id 0 !i - (* Parentheses Role etc *) type prec = Op | Seq | Post | Prim let prec_of_exp = function (* as far as iteration is concerned *) - | VarE _ | BoolE _ | NatE _ | HexE _ | CharE _ | TextE _ | EpsE | StrE _ + | VarE _ | BoolE _ | NatE _ | TextE _ | EpsE | StrE _ | ParenE _ | TupE _ | BrackE _ | CallE _ | HoleE _ -> Prim | AtomE _ | IdxE _ | SliceE _ | UpdE _ | ExtE _ | DotE _ | IterE _ -> Post | SeqE _ -> Seq @@ -84,7 +79,7 @@ let signify_pars prec = function let is_post_exp e = match e.it with | VarE _ | AtomE _ - | BoolE _ | NatE _ | HexE _ | CharE _ + | BoolE _ | NatE _ | EpsE | ParenE _ | TupE _ | BrackE _ | IdxE _ | SliceE _ | ExtE _ @@ -241,7 +236,7 @@ exit_scope : | (* empty *) { atom_vars := List.hd !scopes; scopes := List.tl !scopes } check_atom : - | UPID EOF { VarSet.mem (strip_ticks $1) !atom_vars } + | UPID EOF { VarSet.mem (El.Convert.strip_var_suffix ($1 $ at $sloc)).it !atom_vars } (* Operators *) @@ -345,13 +340,13 @@ deftyp_ : | Nl -> if at = None then y1, Nl::y2, at else Nl::y1, y2, at | Elem (t, prems, hints) -> match t.it with - | VarT (id, []) when prems = [] && hints = [] -> - (Elem id)::y1, y2, Some t.at | AtomT atom | SeqT ({it = AtomT atom; _}::_) | InfixT (_, atom, _) | BrackT (atom, _, _) when at = None -> y1, (Elem (atom, (t, prems), hints))::y2, at + | _ when prems = [] && hints = [] -> + (Elem t)::y1, y2, Some t.at | _ -> let at = Option.value at ~default:t.at in Source.error at "syntax" "misplaced type"; @@ -421,9 +416,9 @@ casetyp : exp_lit : exp_lit_ { $1 $ at $sloc } exp_lit_ : | BOOLLIT { BoolE $1 } - | NATLIT { NatE $1 } - | HEXLIT { HexE $1 } - | CHARLIT { CharE $1 } + | NATLIT { NatE (DecOp, $1) } + | HEXLIT { NatE (HexOp, $1) } + | CHARLIT { NatE (CharOp, $1) } | TEXTLIT { TextE $1 } exp_var_ : @@ -621,9 +616,9 @@ premise_ : sym_prim_ : | gramid { VarG ($1, []) } | gramid_lparen comma_list(arg) RPAREN { VarG ($1, $2) } - | NATLIT { NatG $1 } - | HEXLIT { HexG $1 } - | CHARLIT { CharG $1 } + | NATLIT { NatG (DecOp, $1) } + | HEXLIT { NatG (HexOp, $1) } + | CHARLIT { NatG (CharOp, $1) } | TEXTLIT { TextG $1 } | EPS { EpsG } | LPAREN tup_list(sym) RPAREN diff --git a/spectec/src/il/eq.ml b/spectec/src/il/eq.ml index d3e8a3581a..42a47199c9 100644 --- a/spectec/src/il/eq.ml +++ b/spectec/src/il/eq.ml @@ -45,6 +45,20 @@ and eq_typ t1 t2 = eq_typ t11 t21 && eq_iter iter1 iter2 | _, _ -> t1.it = t2.it +and eq_deftyp dt1 dt2 = + match dt1.it, dt2.it with + | AliasT t1, AliasT t2 -> eq_typ t1 t2 + | NotationT (op1, t1), NotationT (op2, t2) -> op1 = op2 && eq_typ t1 t2 + | StructT tfs1, StructT tfs2 -> eq_list eq_typfield tfs1 tfs2 + | VariantT tcs1, VariantT tcs2 -> eq_list eq_typcase tcs1 tcs2 + | _, _ -> false + +and eq_typfield (atom1, (_binds1, t1, prems1), _) (atom2, (_binds2, t2, prems2), _) = + atom1 = atom2 && eq_typ t1 t2 && eq_list eq_prem prems1 prems2 + +and eq_typcase (atom1, (_binds1, t1, prems1), _) (atom2, (_binds2, t2, prems2), _) = + atom1 = atom2 && eq_typ t1 t2 && eq_list eq_prem prems1 prems2 + (* Expressions *) diff --git a/spectec/src/il/eq.mli b/spectec/src/il/eq.mli index d38eeeec5e..a4ac83fe20 100644 --- a/spectec/src/il/eq.mli +++ b/spectec/src/il/eq.mli @@ -3,6 +3,7 @@ open Ast val eq_id : id -> id -> bool val eq_iter : iter -> iter -> bool val eq_typ : typ -> typ -> bool +val eq_deftyp : deftyp -> deftyp -> bool val eq_exp : exp -> exp -> bool val eq_prem : premise -> premise -> bool diff --git a/spectec/src/util/lib.ml b/spectec/src/util/lib.ml index 0143a00b3d..089fa05745 100644 --- a/spectec/src/util/lib.ml +++ b/spectec/src/util/lib.ml @@ -2,6 +2,18 @@ module List = struct include List + let rec take n xs = + match n, xs with + | 0, _ -> [] + | n, x::xs' when n > 0 -> x :: take (n - 1) xs' + | _ -> failwith "take" + + let rec drop n xs = + match n, xs with + | 0, _ -> xs + | n, _::xs' when n > 0 -> drop (n - 1) xs' + | _ -> failwith "drop" + let split_hd = function | x::xs -> x, xs | _ -> failwith "split_hd" diff --git a/spectec/src/util/lib.mli b/spectec/src/util/lib.mli index 65f6d79ac9..040700e359 100644 --- a/spectec/src/util/lib.mli +++ b/spectec/src/util/lib.mli @@ -2,6 +2,8 @@ module List : sig + val take : int -> 'a list -> 'a list (* raises Failure *) + val drop : int -> 'a list -> 'a list (* raises Failure *) val split_hd : 'a list -> 'a * 'a list (* raises Failure *) val split_last : 'a list -> 'a list * 'a (* raises Failure *) val nub : ('a -> 'a -> bool) -> 'a list -> 'a list diff --git a/spectec/test-frontend/TEST.md b/spectec/test-frontend/TEST.md index a44970ce13..14dd670200 100644 --- a/spectec/test-frontend/TEST.md +++ b/spectec/test-frontend/TEST.md @@ -2,6 +2,19 @@ ```sh $ (dune exec ../src/exe-watsup/main.exe -- test.watsup -o test.tex && cat test.tex) +[elab def] def testmixfix(testmixfix) : nat* +[elab def] def testemptyv1(variant) : nat +[elab def] def testemptyv2(variant) : nat +[elab def] def testemptyv3(variant) : nat +[elab def] def testemptyv4(variant) : nat +[elab def] def testemptyv5(variant) : nat +[elab def] def testemptyv6(variant) : nat +[elab def] def testemptyn1(notation1) : nat +[elab def] def testemptyn2(notation2) : nat +[elab def] def testemptyn3(notation3) : nat +[elab def] def testemptyn4(notation4) : nat +[elab def] def testemptyn5(notation5) : nat +[elab def] def testemptyn6(notation6) : nat $$ \begin{array}{@{}lrrl@{}l@{}} & {\mathit{testmixfix}} &::=& \{{{\mathit{nat}}^\ast}\} ~|~ [{{\mathit{nat}}^\ast}] ~|~ {\mathit{nat}} \rightarrow {\mathit{nat}} \\ @@ -141,6 +154,149 @@ $ (cd ../spec/wasm-3.0 && dune exec ../../src/exe-watsup/main.exe -- *.watsup -v watsup 0.4 generator == Parsing... == Elaboration... +[elab def] def Ki : nat +[elab def] def min(nat, nat) : nat +[elab def] def sum(nat*) : nat +[elab def] def signif(N) : nat +[elab def] def expon(N) : nat +[elab def] def M(N) : nat +[elab def] def E(N) : nat +[elab def] def fzero(N) : fN(N) +[elab def] def setminus(idx*, idx*) : idx* +[elab def] def setminus1(idx, idx*) : idx* +[elab def] def free_dataidx_instr(instr) : dataidx* +[elab def] def free_dataidx_instrs(instr*) : dataidx* +[elab def] def free_dataidx_expr(expr) : dataidx* +[elab def] def free_dataidx_func(func) : dataidx* +[elab def] def free_dataidx_funcs(func*) : dataidx* +[elab def] def concat_bytes((byte*)*) : byte* +[elab def] def size(valtype) : nat +[elab def] def packedsize(packedtype) : nat +[elab def] def storagesize(storagetype) : nat +[elab def] def unpacktype(storagetype) : valtype +[elab def] def unpacknumtype(storagetype) : numtype +[elab def] def sxfield(storagetype) : sx? +[elab def] def diffrt(reftype, reftype) : reftype +[elab def] def idx(typeidx) : typevar +[elab def] def subst_typevar(typevar, typevar*, heaptype*) : heaptype +[elab def] def subst_numtype(numtype, typevar*, heaptype*) : numtype +[elab def] def subst_vectype(vectype, typevar*, heaptype*) : vectype +[elab def] def subst_heaptype(heaptype, typevar*, heaptype*) : heaptype +[elab def] def subst_reftype(reftype, typevar*, heaptype*) : reftype +[elab def] def subst_valtype(valtype, typevar*, heaptype*) : valtype +[elab def] def subst_packedtype(packedtype, typevar*, heaptype*) : packedtype +[elab def] def subst_storagetype(storagetype, typevar*, heaptype*) : storagetype +[elab def] def subst_fieldtype(fieldtype, typevar*, heaptype*) : fieldtype +[elab def] def subst_comptype(comptype, typevar*, heaptype*) : comptype +[elab def] def subst_subtype(subtype, typevar*, heaptype*) : subtype +[elab def] def subst_rectype(rectype, typevar*, heaptype*) : rectype +[elab def] def subst_deftype(deftype, typevar*, heaptype*) : deftype +[elab def] def subst_globaltype(globaltype, typevar*, heaptype*) : globaltype +[elab def] def subst_functype(functype, typevar*, heaptype*) : functype +[elab def] def subst_tabletype(tabletype, typevar*, heaptype*) : tabletype +[elab def] def subst_memtype(memtype, typevar*, heaptype*) : memtype +[elab def] def subst_externtype(externtype, typevar*, heaptype*) : externtype +[elab def] def subst_all_reftype(reftype, heaptype*) : reftype +[elab def] def subst_all_deftype(deftype, heaptype*) : deftype +[elab def] def subst_all_deftypes(deftype*, heaptype*) : deftype* +[elab def] def rollrt(typeidx, rectype) : rectype +[elab def] def unrollrt(rectype) : rectype +[elab def] def rolldt(typeidx, rectype) : deftype* +[elab def] def unrolldt(deftype) : subtype +[elab def] def expanddt(deftype) : comptype +[elab def] def funcsxt(externtype*) : deftype* +[elab def] def globalsxt(externtype*) : globaltype* +[elab def] def tablesxt(externtype*) : tabletype* +[elab def] def memsxt(externtype*) : memtype* +[elab def] def memop0 : memop +[elab def] def s33_to_u32(s33) : u32 +[elab def] def signed(N, nat) : int +[elab def] def invsigned(N, int) : nat +[elab def] def unop(unop_numtype, numtype, c) : c_numtype* +[elab def] def binop(binop_numtype, numtype, c, c) : c_numtype* +[elab def] def testop(testop_numtype, numtype, c) : c_numtype +[elab def] def relop(relop_numtype, numtype, c, c) : c_numtype +[elab def] def cvtop(cvtop, numtype, numtype, sx?, c) : c_numtype* +[elab def] def wrap(nat, nat, c) : nat +[elab def] def ext(nat, nat, sx, c) : c_numtype +[elab def] def ibytes(N, iN(N)) : byte* +[elab def] def fbytes(N, fN(N)) : byte* +[elab def] def ntbytes(numtype, c) : byte* +[elab def] def ztbytes(storagetype, c) : byte* +[elab def] def invibytes(N, byte*) : iN(N) +[elab def] def invfbytes(N, byte*) : fN(N) +[elab def] def inst_reftype(moduleinst, reftype) : reftype +[elab def] def default(valtype) : val? +[elab def] def packval(storagetype, val) : fieldval +[elab def] def unpackval(storagetype, sx?, fieldval) : val +[elab def] def funcsxv(externval*) : funcaddr* +[elab def] def globalsxv(externval*) : globaladdr* +[elab def] def tablesxv(externval*) : tableaddr* +[elab def] def memsxv(externval*) : memaddr* +[elab def] def store(state) : store +[elab def] def frame(state) : frame +[elab def] def funcaddr(state) : funcaddr* +[elab def] def funcinst(state) : funcinst* +[elab def] def globalinst(state) : globalinst* +[elab def] def tableinst(state) : tableinst* +[elab def] def meminst(state) : meminst* +[elab def] def eleminst(state) : eleminst* +[elab def] def datainst(state) : datainst* +[elab def] def structinst(state) : structinst* +[elab def] def arrayinst(state) : arrayinst* +[elab def] def moduleinst(state) : moduleinst +[elab def] def type(state, typeidx) : deftype +[elab def] def func(state, funcidx) : funcinst +[elab def] def global(state, globalidx) : globalinst +[elab def] def table(state, tableidx) : tableinst +[elab def] def mem(state, memidx) : meminst +[elab def] def elem(state, tableidx) : eleminst +[elab def] def data(state, dataidx) : datainst +[elab def] def local(state, localidx) : val? +[elab def] def with_local(state, localidx, val) : state +[elab def] def with_global(state, globalidx, val) : state +[elab def] def with_table(state, tableidx, nat, ref) : state +[elab def] def with_tableinst(state, tableidx, tableinst) : state +[elab def] def with_mem(state, memidx, nat, nat, byte*) : state +[elab def] def with_meminst(state, memidx, meminst) : state +[elab def] def with_elem(state, elemidx, ref*) : state +[elab def] def with_data(state, dataidx, byte*) : state +[elab def] def with_struct(state, structaddr, nat, fieldval) : state +[elab def] def with_array(state, arrayaddr, nat, fieldval) : state +[elab def] def ext_structinst(state, structinst*) : state +[elab def] def ext_arrayinst(state, arrayinst*) : state +[elab def] def growtable(tableinst, nat, ref) : tableinst +[elab def] def growmemory(meminst, nat) : meminst +[elab def] def with_locals(context, localidx*, localtype*) : context +[elab def] def clostype(context, deftype) : deftype +[elab def] def clostypes(deftype*) : deftype* +[elab def] def before(heaptype, typeidx, nat) : bool +[elab def] def unrollht(context, heaptype) : subtype +[elab def] def in_numtype(numtype, numtype*) : bool +[elab def] def in_binop(binop_numtype, ibinop*) : bool +[elab def] def blocktype(state, blocktype) : functype +[elab def] def alloctypes(type*) : deftype* +[elab def] def allocfunc(store, moduleinst, func) : (store, funcaddr) +[elab def] def allocfuncs(store, moduleinst, func*) : (store, funcaddr*) +[elab def] def allocglobal(store, globaltype, val) : (store, globaladdr) +[elab def] def allocglobals(store, globaltype*, val*) : (store, globaladdr*) +[elab def] def alloctable(store, tabletype, ref) : (store, tableaddr) +[elab def] def alloctables(store, tabletype*, ref*) : (store, tableaddr*) +[elab def] def allocmem(store, memtype) : (store, memaddr) +[elab def] def allocmems(store, memtype*) : (store, memaddr*) +[elab def] def allocelem(store, reftype, ref*) : (store, elemaddr) +[elab def] def allocelems(store, reftype*, (ref*)*) : (store, elemaddr*) +[elab def] def allocdata(store, byte*) : (store, dataaddr) +[elab def] def allocdatas(store, (byte*)*) : (store, dataaddr*) +[elab def] def instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export) : exportinst +[elab def] def allocmodule(store, module, externval*, val*, ref*, (ref*)*) : (store, moduleinst) +[elab def] def concat_instr((instr*)*) : instr* +[elab def] def runelem(elem, idx) : instr* +[elab def] def rundata(data, idx) : instr* +[elab def] def instantiate(store, module, externval*) : config +[elab def] def invoke(store, funcaddr, val*) : config +[elab def] def utf8(name) : byte* +[elab def] def concat_locals((local*)*) : local* ;; 0-aux.watsup:11.1-11.15 syntax N = nat @@ -164,12 +320,12 @@ rec { ;; 0-aux.watsup:27.1-27.25 def min : (nat, nat) -> nat - ;; 0-aux.watsup:28.1-28.19 - def {j : nat} min(0, j) = 0 - ;; 0-aux.watsup:29.1-29.19 - def {i : nat} min(i, 0) = 0 ;; 0-aux.watsup:30.1-30.38 def {i : nat, j : nat} min((i + 1), (j + 1)) = $min(i, j) + ;; 0-aux.watsup:29.1-29.19 + def {i : nat} min(i, 0) = 0 + ;; 0-aux.watsup:28.1-28.19 + def {j : nat} min(0, j) = 0 } ;; 0-aux.watsup:32.1-32.21 @@ -177,10 +333,10 @@ rec { ;; 0-aux.watsup:32.1-32.21 def sum : nat* -> nat - ;; 0-aux.watsup:33.1-33.18 - def sum([]) = 0 ;; 0-aux.watsup:34.1-34.35 def {n : n, n'* : n*} sum([n] :: n'*{n'}) = (n + $sum(n'*{n'})) + ;; 0-aux.watsup:33.1-33.18 + def sum([]) = 0 } ;; 1-syntax.watsup:5.1-5.85 @@ -218,17 +374,17 @@ syntax s33 = sN ;; 1-syntax.watsup:35.1-35.21 def signif : N -> nat - ;; 1-syntax.watsup:36.1-36.21 - def signif(32) = 23 ;; 1-syntax.watsup:37.1-37.21 def signif(64) = 52 + ;; 1-syntax.watsup:36.1-36.21 + def signif(32) = 23 ;; 1-syntax.watsup:39.1-39.20 def expon : N -> nat - ;; 1-syntax.watsup:40.1-40.19 - def expon(32) = 8 ;; 1-syntax.watsup:41.1-41.20 def expon(64) = 11 + ;; 1-syntax.watsup:40.1-40.19 + def expon(32) = 8 ;; 1-syntax.watsup:43.1-43.35 def M : N -> nat @@ -705,14 +861,14 @@ rec { ;; 2-syntax-aux.watsup:8.1-8.33 def setminus1 : (idx, idx*) -> idx* - ;; 2-syntax-aux.watsup:13.1-13.27 - def {x : idx} setminus1(x, []) = [x] - ;; 2-syntax-aux.watsup:14.1-14.57 - def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = [] - -- if (x = y_1) ;; 2-syntax-aux.watsup:15.1-15.60 def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = $setminus1(x, y*{y}) -- otherwise + ;; 2-syntax-aux.watsup:14.1-14.57 + def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = [] + -- if (x = y_1) + ;; 2-syntax-aux.watsup:13.1-13.27 + def {x : idx} setminus1(x, []) = [x] } ;; 2-syntax-aux.watsup:7.1-7.49 @@ -720,30 +876,30 @@ rec { ;; 2-syntax-aux.watsup:7.1-7.49 def setminus : (idx*, idx*) -> idx* - ;; 2-syntax-aux.watsup:10.1-10.29 - def {y* : idx*} setminus([], y*{y}) = [] ;; 2-syntax-aux.watsup:11.1-11.66 def {x* : idx*, x_1 : idx, y* : idx*} setminus([x_1] :: x*{x}, y*{y}) = $setminus1(x_1, y*{y}) :: $setminus(x*{x}, y*{y}) + ;; 2-syntax-aux.watsup:10.1-10.29 + def {y* : idx*} setminus([], y*{y}) = [] } ;; 2-syntax-aux.watsup:20.1-20.68 def free_dataidx_instr : instr -> dataidx* - ;; 2-syntax-aux.watsup:21.1-21.45 - def {x : idx, y : idx} free_dataidx_instr(MEMORY.INIT_instr(x, y)) = [y] - ;; 2-syntax-aux.watsup:22.1-22.41 - def {x : idx} free_dataidx_instr(DATA.DROP_instr(x)) = [x] ;; 2-syntax-aux.watsup:23.1-23.34 def {in : instr} free_dataidx_instr(in) = [] + ;; 2-syntax-aux.watsup:22.1-22.41 + def {x : idx} free_dataidx_instr(DATA.DROP_instr(x)) = [x] + ;; 2-syntax-aux.watsup:21.1-21.45 + def {x : idx, y : idx} free_dataidx_instr(MEMORY.INIT_instr(x, y)) = [y] ;; 2-syntax-aux.watsup:25.1-25.70 rec { ;; 2-syntax-aux.watsup:25.1-25.70 def free_dataidx_instrs : instr* -> dataidx* - ;; 2-syntax-aux.watsup:26.1-26.36 - def free_dataidx_instrs([]) = [] ;; 2-syntax-aux.watsup:27.1-27.99 def {instr : instr, instr'* : instr*} free_dataidx_instrs([instr] :: instr'*{instr'}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr'}) + ;; 2-syntax-aux.watsup:26.1-26.36 + def free_dataidx_instrs([]) = [] } ;; 2-syntax-aux.watsup:29.1-29.66 @@ -761,10 +917,10 @@ rec { ;; 2-syntax-aux.watsup:35.1-35.68 def free_dataidx_funcs : func* -> dataidx* - ;; 2-syntax-aux.watsup:36.1-36.35 - def free_dataidx_funcs([]) = [] ;; 2-syntax-aux.watsup:37.1-37.92 def {func : func, func'* : func*} free_dataidx_funcs([func] :: func'*{func'}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func'}) + ;; 2-syntax-aux.watsup:36.1-36.35 + def free_dataidx_funcs([]) = [] } ;; 2-syntax-aux.watsup:46.1-46.59 @@ -772,66 +928,66 @@ rec { ;; 2-syntax-aux.watsup:46.1-46.59 def concat_bytes : byte** -> byte* - ;; 2-syntax-aux.watsup:47.1-47.29 - def concat_bytes([]) = [] ;; 2-syntax-aux.watsup:48.1-48.58 def {b* : byte*, b'** : byte**} concat_bytes([b*{b}] :: b'*{b'}*{b'}) = b*{b} :: $concat_bytes(b'*{b'}*{b'}) + ;; 2-syntax-aux.watsup:47.1-47.29 + def concat_bytes([]) = [] } ;; 2-syntax-aux.watsup:59.1-59.55 def size : valtype -> nat - ;; 2-syntax-aux.watsup:60.1-60.20 - def size(I32_valtype) = 32 - ;; 2-syntax-aux.watsup:61.1-61.20 - def size(I64_valtype) = 64 - ;; 2-syntax-aux.watsup:62.1-62.20 - def size(F32_valtype) = 32 - ;; 2-syntax-aux.watsup:63.1-63.20 - def size(F64_valtype) = 64 ;; 2-syntax-aux.watsup:64.1-64.22 def size(V128_valtype) = 128 + ;; 2-syntax-aux.watsup:63.1-63.20 + def size(F64_valtype) = 64 + ;; 2-syntax-aux.watsup:62.1-62.20 + def size(F32_valtype) = 32 + ;; 2-syntax-aux.watsup:61.1-61.20 + def size(I64_valtype) = 64 + ;; 2-syntax-aux.watsup:60.1-60.20 + def size(I32_valtype) = 32 ;; 2-syntax-aux.watsup:66.1-66.50 def packedsize : packedtype -> nat - ;; 2-syntax-aux.watsup:67.1-67.24 - def packedsize(I8_packedtype) = 8 ;; 2-syntax-aux.watsup:68.1-68.26 def packedsize(I16_packedtype) = 16 + ;; 2-syntax-aux.watsup:67.1-67.24 + def packedsize(I8_packedtype) = 8 ;; 2-syntax-aux.watsup:70.1-70.52 def storagesize : storagetype -> nat - ;; 2-syntax-aux.watsup:71.1-71.43 - def {valtype : valtype} storagesize(valtype <: storagetype) = $size(valtype) ;; 2-syntax-aux.watsup:72.1-72.55 def {packedtype : packedtype} storagesize(packedtype <: storagetype) = $packedsize(packedtype) + ;; 2-syntax-aux.watsup:71.1-71.43 + def {valtype : valtype} storagesize(valtype <: storagetype) = $size(valtype) ;; 2-syntax-aux.watsup:77.1-77.62 def unpacktype : storagetype -> valtype - ;; 2-syntax-aux.watsup:78.1-78.35 - def {valtype : valtype} unpacktype(valtype <: storagetype) = valtype ;; 2-syntax-aux.watsup:79.1-79.34 def {packedtype : packedtype} unpacktype(packedtype <: storagetype) = I32_valtype + ;; 2-syntax-aux.watsup:78.1-78.35 + def {valtype : valtype} unpacktype(valtype <: storagetype) = valtype ;; 2-syntax-aux.watsup:81.1-81.65 def unpacknumtype : storagetype -> numtype - ;; 2-syntax-aux.watsup:82.1-82.38 - def {numtype : numtype} unpacknumtype(numtype <: storagetype) = numtype ;; 2-syntax-aux.watsup:83.1-83.37 def {packedtype : packedtype} unpacknumtype(packedtype <: storagetype) = I32_numtype + ;; 2-syntax-aux.watsup:82.1-82.38 + def {numtype : numtype} unpacknumtype(numtype <: storagetype) = numtype ;; 2-syntax-aux.watsup:85.1-85.51 def sxfield : storagetype -> sx? - ;; 2-syntax-aux.watsup:86.1-86.28 - def {valtype : valtype} sxfield(valtype <: storagetype) = ?() ;; 2-syntax-aux.watsup:87.1-87.29 def {packedtype : packedtype} sxfield(packedtype <: storagetype) = ?(S_sx) + ;; 2-syntax-aux.watsup:86.1-86.28 + def {valtype : valtype} sxfield(valtype <: storagetype) = ?() ;; 2-syntax-aux.watsup:92.1-92.59 def diffrt : (reftype, reftype) -> reftype - ;; 2-syntax-aux.watsup:94.1-94.64 - def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) = REF_reftype(`NULL%?`(?()), ht_1) ;; 2-syntax-aux.watsup:95.1-95.65 def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?()), ht_2)) = REF_reftype(nul_1, ht_1) + ;; 2-syntax-aux.watsup:94.1-94.64 + def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) = REF_reftype(`NULL%?`(?()), ht_1) ;; 2-syntax-aux.watsup:100.1-100.42 syntax typevar = @@ -848,14 +1004,14 @@ rec { ;; 2-syntax-aux.watsup:109.1-109.92 def subst_typevar : (typevar, typevar*, heaptype*) -> heaptype - ;; 2-syntax-aux.watsup:134.1-134.38 - def {xx : typevar} subst_typevar(xx, [], []) = (xx <: heaptype) - ;; 2-syntax-aux.watsup:135.1-135.95 - def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 - -- if (xx = xx_1) ;; 2-syntax-aux.watsup:136.1-136.92 def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = $subst_typevar(xx, xx'*{xx'}, ht'*{ht'}) -- otherwise + ;; 2-syntax-aux.watsup:135.1-135.95 + def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 + -- if (xx = xx_1) + ;; 2-syntax-aux.watsup:134.1-134.38 + def {xx : typevar} subst_typevar(xx, [], []) = (xx <: heaptype) } ;; 2-syntax-aux.watsup:111.1-111.92 @@ -878,13 +1034,13 @@ rec { ;; 2-syntax-aux.watsup:113.1-113.92 def subst_heaptype : (heaptype, typevar*, heaptype*) -> heaptype - ;; 2-syntax-aux.watsup:141.1-141.67 - def {ht* : heaptype*, xx* : typevar*, xx' : typevar} subst_heaptype((xx' <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) - ;; 2-syntax-aux.watsup:142.1-142.65 - def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_heaptype((dt <: heaptype), xx*{xx}, ht*{ht}) = ($subst_deftype(dt, xx*{xx}, ht*{ht}) <: heaptype) ;; 2-syntax-aux.watsup:143.1-143.55 def {ht* : heaptype*, ht' : heaptype, xx* : typevar*} subst_heaptype(ht', xx*{xx}, ht*{ht}) = ht' -- otherwise + ;; 2-syntax-aux.watsup:142.1-142.65 + def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_heaptype((dt <: heaptype), xx*{xx}, ht*{ht}) = ($subst_deftype(dt, xx*{xx}, ht*{ht}) <: heaptype) + ;; 2-syntax-aux.watsup:141.1-141.67 + def {ht* : heaptype*, xx* : typevar*, xx' : typevar} subst_heaptype((xx' <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) ;; 2-syntax-aux.watsup:114.1-114.92 def subst_reftype : (reftype, typevar*, heaptype*) -> reftype @@ -893,21 +1049,21 @@ def subst_reftype : (reftype, typevar*, heaptype*) -> reftype ;; 2-syntax-aux.watsup:115.1-115.92 def subst_valtype : (valtype, typevar*, heaptype*) -> valtype - ;; 2-syntax-aux.watsup:147.1-147.64 - def {ht* : heaptype*, nt : numtype, xx* : typevar*} subst_valtype((nt <: valtype), xx*{xx}, ht*{ht}) = ($subst_numtype(nt, xx*{xx}, ht*{ht}) <: valtype) - ;; 2-syntax-aux.watsup:148.1-148.64 - def {ht* : heaptype*, vt : vectype, xx* : typevar*} subst_valtype((vt <: valtype), xx*{xx}, ht*{ht}) = ($subst_vectype(vt, xx*{xx}, ht*{ht}) <: valtype) - ;; 2-syntax-aux.watsup:149.1-149.64 - def {ht* : heaptype*, rt : reftype, xx* : typevar*} subst_valtype((rt <: valtype), xx*{xx}, ht*{ht}) = ($subst_reftype(rt, xx*{xx}, ht*{ht}) <: valtype) ;; 2-syntax-aux.watsup:150.1-150.40 def {ht* : heaptype*, xx* : typevar*} subst_valtype(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + ;; 2-syntax-aux.watsup:149.1-149.64 + def {ht* : heaptype*, rt : reftype, xx* : typevar*} subst_valtype((rt <: valtype), xx*{xx}, ht*{ht}) = ($subst_reftype(rt, xx*{xx}, ht*{ht}) <: valtype) + ;; 2-syntax-aux.watsup:148.1-148.64 + def {ht* : heaptype*, vt : vectype, xx* : typevar*} subst_valtype((vt <: valtype), xx*{xx}, ht*{ht}) = ($subst_vectype(vt, xx*{xx}, ht*{ht}) <: valtype) + ;; 2-syntax-aux.watsup:147.1-147.64 + def {ht* : heaptype*, nt : numtype, xx* : typevar*} subst_valtype((nt <: valtype), xx*{xx}, ht*{ht}) = ($subst_numtype(nt, xx*{xx}, ht*{ht}) <: valtype) ;; 2-syntax-aux.watsup:118.1-118.92 def subst_storagetype : (storagetype, typevar*, heaptype*) -> storagetype - ;; 2-syntax-aux.watsup:154.1-154.66 - def {ht* : heaptype*, t : valtype, xx* : typevar*} subst_storagetype((t <: storagetype), xx*{xx}, ht*{ht}) = ($subst_valtype(t, xx*{xx}, ht*{ht}) <: storagetype) ;; 2-syntax-aux.watsup:155.1-155.71 def {ht* : heaptype*, pt : packedtype, xx* : typevar*} subst_storagetype((pt <: storagetype), xx*{xx}, ht*{ht}) = ($subst_packedtype(pt, xx*{xx}, ht*{ht}) <: storagetype) + ;; 2-syntax-aux.watsup:154.1-154.66 + def {ht* : heaptype*, t : valtype, xx* : typevar*} subst_storagetype((t <: storagetype), xx*{xx}, ht*{ht}) = ($subst_valtype(t, xx*{xx}, ht*{ht}) <: storagetype) ;; 2-syntax-aux.watsup:119.1-119.92 def subst_fieldtype : (fieldtype, typevar*, heaptype*) -> fieldtype @@ -916,19 +1072,19 @@ def subst_fieldtype : (fieldtype, typevar*, heaptype*) -> fieldtype ;; 2-syntax-aux.watsup:121.1-121.92 def subst_comptype : (comptype, typevar*, heaptype*) -> comptype - ;; 2-syntax-aux.watsup:159.1-159.85 - def {ht* : heaptype*, xx* : typevar*, yt* : fieldtype*} subst_comptype(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) - ;; 2-syntax-aux.watsup:160.1-160.81 - def {ht* : heaptype*, xx* : typevar*, yt : fieldtype} subst_comptype(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:161.1-161.78 def {ft : functype, ht* : heaptype*, xx* : typevar*} subst_comptype(FUNC_comptype(ft), xx*{xx}, ht*{ht}) = FUNC_comptype($subst_functype(ft, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:160.1-160.81 + def {ht* : heaptype*, xx* : typevar*, yt : fieldtype} subst_comptype(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:159.1-159.85 + def {ht* : heaptype*, xx* : typevar*, yt* : fieldtype*} subst_comptype(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) ;; 2-syntax-aux.watsup:122.1-122.92 def subst_subtype : (subtype, typevar*, heaptype*) -> subtype - ;; 2-syntax-aux.watsup:163.1-164.76 - def {ct : comptype, fin : fin, ht* : heaptype*, xx* : typevar*, y* : idx*} subst_subtype(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:165.1-166.73 def {ct : comptype, fin : fin, ht* : heaptype*, ht'* : heaptype*, xx* : typevar*} subst_subtype(SUBD_subtype(fin, ht'*{ht'}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx}, ht*{ht})*{ht'}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:163.1-164.76 + def {ct : comptype, fin : fin, ht* : heaptype*, xx* : typevar*, y* : idx*} subst_subtype(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:123.1-123.92 def subst_rectype : (rectype, typevar*, heaptype*) -> rectype @@ -963,14 +1119,14 @@ def subst_memtype : (memtype, typevar*, heaptype*) -> memtype ;; 2-syntax-aux.watsup:131.1-131.92 def subst_externtype : (externtype, typevar*, heaptype*) -> externtype - ;; 2-syntax-aux.watsup:177.1-177.79 - def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_externtype(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:178.1-178.86 - def {gt : globaltype, ht* : heaptype*, xx* : typevar*} subst_externtype(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:179.1-179.83 - def {ht* : heaptype*, tt : tabletype, xx* : typevar*} subst_externtype(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:180.1-180.77 def {ht* : heaptype*, mt : memtype, xx* : typevar*} subst_externtype(MEM_externtype(mt), xx*{xx}, ht*{ht}) = MEM_externtype($subst_memtype(mt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:179.1-179.83 + def {ht* : heaptype*, tt : tabletype, xx* : typevar*} subst_externtype(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:178.1-178.86 + def {gt : globaltype, ht* : heaptype*, xx* : typevar*} subst_externtype(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:177.1-177.79 + def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_externtype(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:183.1-183.74 def subst_all_reftype : (reftype, heaptype*) -> reftype @@ -987,10 +1143,10 @@ rec { ;; 2-syntax-aux.watsup:189.1-189.77 def subst_all_deftypes : (deftype*, heaptype*) -> deftype* - ;; 2-syntax-aux.watsup:191.1-191.40 - def {ht* : heaptype*} subst_all_deftypes([], ht*{ht}) = [] ;; 2-syntax-aux.watsup:192.1-192.101 def {dt* : deftype*, dt_1 : deftype, ht* : heaptype*} subst_all_deftypes([dt_1] :: dt*{dt}, ht*{ht}) = [$subst_all_deftype(dt_1, ht*{ht})] :: $subst_all_deftypes(dt*{dt}, ht*{ht}) + ;; 2-syntax-aux.watsup:191.1-191.40 + def {ht* : heaptype*} subst_all_deftypes([], ht*{ht}) = [] } ;; 2-syntax-aux.watsup:197.1-197.65 @@ -1034,13 +1190,13 @@ rec { ;; 2-syntax-aux.watsup:221.1-221.64 def funcsxt : externtype* -> deftype* - ;; 2-syntax-aux.watsup:226.1-226.24 - def funcsxt([]) = [] - ;; 2-syntax-aux.watsup:227.1-227.47 - def {dt : deftype, et* : externtype*} funcsxt([FUNC_externtype(dt)] :: et*{et}) = [dt] :: $funcsxt(et*{et}) ;; 2-syntax-aux.watsup:228.1-228.59 def {et* : externtype*, externtype : externtype} funcsxt([externtype] :: et*{et}) = $funcsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:227.1-227.47 + def {dt : deftype, et* : externtype*} funcsxt([FUNC_externtype(dt)] :: et*{et}) = [dt] :: $funcsxt(et*{et}) + ;; 2-syntax-aux.watsup:226.1-226.24 + def funcsxt([]) = [] } ;; 2-syntax-aux.watsup:222.1-222.66 @@ -1048,13 +1204,13 @@ rec { ;; 2-syntax-aux.watsup:222.1-222.66 def globalsxt : externtype* -> globaltype* - ;; 2-syntax-aux.watsup:230.1-230.26 - def globalsxt([]) = [] - ;; 2-syntax-aux.watsup:231.1-231.53 - def {et* : externtype*, gt : globaltype} globalsxt([GLOBAL_externtype(gt)] :: et*{et}) = [gt] :: $globalsxt(et*{et}) ;; 2-syntax-aux.watsup:232.1-232.63 def {et* : externtype*, externtype : externtype} globalsxt([externtype] :: et*{et}) = $globalsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:231.1-231.53 + def {et* : externtype*, gt : globaltype} globalsxt([GLOBAL_externtype(gt)] :: et*{et}) = [gt] :: $globalsxt(et*{et}) + ;; 2-syntax-aux.watsup:230.1-230.26 + def globalsxt([]) = [] } ;; 2-syntax-aux.watsup:223.1-223.65 @@ -1062,13 +1218,13 @@ rec { ;; 2-syntax-aux.watsup:223.1-223.65 def tablesxt : externtype* -> tabletype* - ;; 2-syntax-aux.watsup:234.1-234.25 - def tablesxt([]) = [] - ;; 2-syntax-aux.watsup:235.1-235.50 - def {et* : externtype*, tt : tabletype} tablesxt([TABLE_externtype(tt)] :: et*{et}) = [tt] :: $tablesxt(et*{et}) ;; 2-syntax-aux.watsup:236.1-236.61 def {et* : externtype*, externtype : externtype} tablesxt([externtype] :: et*{et}) = $tablesxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:235.1-235.50 + def {et* : externtype*, tt : tabletype} tablesxt([TABLE_externtype(tt)] :: et*{et}) = [tt] :: $tablesxt(et*{et}) + ;; 2-syntax-aux.watsup:234.1-234.25 + def tablesxt([]) = [] } ;; 2-syntax-aux.watsup:224.1-224.63 @@ -1076,13 +1232,13 @@ rec { ;; 2-syntax-aux.watsup:224.1-224.63 def memsxt : externtype* -> memtype* - ;; 2-syntax-aux.watsup:238.1-238.23 - def memsxt([]) = [] - ;; 2-syntax-aux.watsup:239.1-239.44 - def {et* : externtype*, mt : memtype} memsxt([MEM_externtype(mt)] :: et*{et}) = [mt] :: $memsxt(et*{et}) ;; 2-syntax-aux.watsup:240.1-240.57 def {et* : externtype*, externtype : externtype} memsxt([externtype] :: et*{et}) = $memsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:239.1-239.44 + def {et* : externtype*, mt : memtype} memsxt([MEM_externtype(mt)] :: et*{et}) = [mt] :: $memsxt(et*{et}) + ;; 2-syntax-aux.watsup:238.1-238.23 + def memsxt([]) = [] } ;; 2-syntax-aux.watsup:249.1-249.33 @@ -1095,12 +1251,12 @@ def s33_to_u32 : s33 -> u32 ;; 3-numerics.watsup:12.1-12.57 def signed : (N, nat) -> int - ;; 3-numerics.watsup:13.1-13.54 - def {N : N, i : nat} signed(N, i) = (i <: int) - -- if (0 <= (2 ^ (N - 1))) ;; 3-numerics.watsup:14.1-14.60 def {N : N, i : nat} signed(N, i) = ((i - (2 ^ N)) <: int) -- if (((2 ^ (N - 1)) <= i) /\ (i < (2 ^ N))) + ;; 3-numerics.watsup:13.1-13.54 + def {N : N, i : nat} signed(N, i) = (i <: int) + -- if (0 <= (2 ^ (N - 1))) ;; 3-numerics.watsup:16.1-16.63 def invsigned : (N, int) -> nat @@ -1404,45 +1560,45 @@ def inst_reftype : (moduleinst, reftype) -> reftype ;; 5-runtime-aux.watsup:19.1-19.52 def default : valtype -> val? - ;; 5-runtime-aux.watsup:21.1-21.34 - def default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) - ;; 5-runtime-aux.watsup:22.1-22.34 - def default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) - ;; 5-runtime-aux.watsup:23.1-23.34 - def default(F32_valtype) = ?(CONST_val(F32_numtype, 0)) - ;; 5-runtime-aux.watsup:24.1-24.34 - def default(F64_valtype) = ?(CONST_val(F64_numtype, 0)) - ;; 5-runtime-aux.watsup:25.1-25.42 - def {ht : heaptype} default(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) ;; 5-runtime-aux.watsup:26.1-26.31 def {ht : heaptype} default(REF_valtype(`NULL%?`(?()), ht)) = ?() + ;; 5-runtime-aux.watsup:25.1-25.42 + def {ht : heaptype} default(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) + ;; 5-runtime-aux.watsup:24.1-24.34 + def default(F64_valtype) = ?(CONST_val(F64_numtype, 0)) + ;; 5-runtime-aux.watsup:23.1-23.34 + def default(F32_valtype) = ?(CONST_val(F32_numtype, 0)) + ;; 5-runtime-aux.watsup:22.1-22.34 + def default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) + ;; 5-runtime-aux.watsup:21.1-21.34 + def default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) ;; 5-runtime-aux.watsup:31.1-31.73 def packval : (storagetype, val) -> fieldval - ;; 5-runtime-aux.watsup:34.1-34.27 - def {t : valtype, val : val} packval((t <: storagetype), val) = (val <: fieldval) ;; 5-runtime-aux.watsup:35.1-35.70 def {i : nat, pt : packedtype} packval((pt <: storagetype), CONST_val(I32_numtype, i)) = PACK_fieldval(pt, $wrap(32, $packedsize(pt), i)) + ;; 5-runtime-aux.watsup:34.1-34.27 + def {t : valtype, val : val} packval((t <: storagetype), val) = (val <: fieldval) ;; 5-runtime-aux.watsup:32.1-32.83 def unpackval : (storagetype, sx?, fieldval) -> val - ;; 5-runtime-aux.watsup:37.1-37.34 - def {t : valtype, val : val} unpackval((t <: storagetype), ?(), (val <: fieldval)) = val ;; 5-runtime-aux.watsup:38.1-38.79 def {i : nat, pt : packedtype, sx : sx} unpackval((pt <: storagetype), ?(sx), PACK_fieldval(pt, i)) = CONST_val(I32_numtype, $ext($packedsize(pt), 32, sx, i)) + ;; 5-runtime-aux.watsup:37.1-37.34 + def {t : valtype, val : val} unpackval((t <: storagetype), ?(), (val <: fieldval)) = val ;; 5-runtime-aux.watsup:43.1-43.62 rec { ;; 5-runtime-aux.watsup:43.1-43.62 def funcsxv : externval* -> funcaddr* - ;; 5-runtime-aux.watsup:48.1-48.24 - def funcsxv([]) = [] - ;; 5-runtime-aux.watsup:49.1-49.47 - def {fa : funcaddr, xv* : externval*} funcsxv([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) ;; 5-runtime-aux.watsup:50.1-50.58 def {externval : externval, xv* : externval*} funcsxv([externval] :: xv*{xv}) = $funcsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:49.1-49.47 + def {fa : funcaddr, xv* : externval*} funcsxv([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:48.1-48.24 + def funcsxv([]) = [] } ;; 5-runtime-aux.watsup:44.1-44.64 @@ -1450,13 +1606,13 @@ rec { ;; 5-runtime-aux.watsup:44.1-44.64 def globalsxv : externval* -> globaladdr* - ;; 5-runtime-aux.watsup:52.1-52.26 - def globalsxv([]) = [] - ;; 5-runtime-aux.watsup:53.1-53.53 - def {ga : globaladdr, xv* : externval*} globalsxv([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) ;; 5-runtime-aux.watsup:54.1-54.62 def {externval : externval, xv* : externval*} globalsxv([externval] :: xv*{xv}) = $globalsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:53.1-53.53 + def {ga : globaladdr, xv* : externval*} globalsxv([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:52.1-52.26 + def globalsxv([]) = [] } ;; 5-runtime-aux.watsup:45.1-45.63 @@ -1464,13 +1620,13 @@ rec { ;; 5-runtime-aux.watsup:45.1-45.63 def tablesxv : externval* -> tableaddr* - ;; 5-runtime-aux.watsup:56.1-56.25 - def tablesxv([]) = [] - ;; 5-runtime-aux.watsup:57.1-57.50 - def {ta : tableaddr, xv* : externval*} tablesxv([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) ;; 5-runtime-aux.watsup:58.1-58.60 def {externval : externval, xv* : externval*} tablesxv([externval] :: xv*{xv}) = $tablesxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:57.1-57.50 + def {ta : tableaddr, xv* : externval*} tablesxv([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) + ;; 5-runtime-aux.watsup:56.1-56.25 + def tablesxv([]) = [] } ;; 5-runtime-aux.watsup:46.1-46.61 @@ -1478,13 +1634,13 @@ rec { ;; 5-runtime-aux.watsup:46.1-46.61 def memsxv : externval* -> memaddr* - ;; 5-runtime-aux.watsup:60.1-60.23 - def memsxv([]) = [] - ;; 5-runtime-aux.watsup:61.1-61.44 - def {ma : memaddr, xv* : externval*} memsxv([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) ;; 5-runtime-aux.watsup:62.1-62.56 def {externval : externval, xv* : externval*} memsxv([externval] :: xv*{xv}) = $memsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:61.1-61.44 + def {ma : memaddr, xv* : externval*} memsxv([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:60.1-60.23 + def memsxv([]) = [] } ;; 5-runtime-aux.watsup:72.1-72.57 @@ -1684,10 +1840,10 @@ rec { ;; 6-typing.watsup:26.1-26.86 def with_locals : (context, localidx*, localtype*) -> context - ;; 6-typing.watsup:28.1-28.34 - def {C : context} with_locals(C, [], []) = C ;; 6-typing.watsup:29.1-29.85 def {C : context, lt* : localtype*, lt_1 : localtype, x* : idx*, x_1 : idx} with_locals(C, [x_1] :: x*{x}, [lt_1] :: lt*{lt}) = $with_locals(C[LOCAL_context[x_1] = lt_1], x*{x}, lt*{lt}) + ;; 6-typing.watsup:28.1-28.34 + def {C : context} with_locals(C, [], []) = C } ;; 6-typing.watsup:33.1-33.65 @@ -1695,11 +1851,11 @@ rec { ;; 6-typing.watsup:33.1-33.65 def clostypes : deftype* -> deftype* - ;; 6-typing.watsup:37.1-37.26 - def clostypes([]) = [] ;; 6-typing.watsup:38.1-38.93 def {dt* : deftype*, dt'* : deftype*, dt_N : deftype} clostypes(dt*{dt} :: [dt_N]) = dt'*{dt'} :: [$subst_all_deftype(dt_N, (dt' <: heaptype)*{dt'})] -- if (dt'*{dt'} = $clostypes(dt*{dt})) + ;; 6-typing.watsup:37.1-37.26 + def clostypes([]) = [] } ;; 6-typing.watsup:32.1-32.65 @@ -1722,19 +1878,19 @@ relation Vectype_ok: `%|-%:OK`(context, vectype) ;; 6-typing.watsup:49.1-49.72 relation Heaptype_ok: `%|-%:OK`(context, heaptype) - ;; 6-typing.watsup:60.1-61.24 - rule abs {C : context, absheaptype : absheaptype}: - `%|-%:OK`(C, (absheaptype <: heaptype)) + ;; 6-typing.watsup:67.1-69.22 + rule rec {C : context, i : nat, st : subtype}: + `%|-%:OK`(C, REC_heaptype(i)) + -- if (C.REC_context[i] = st) ;; 6-typing.watsup:63.1-65.23 rule typeidx {C : context, dt : deftype, x : idx}: `%|-%:OK`(C, _IDX_heaptype(x)) -- if (C.TYPE_context[x] = dt) - ;; 6-typing.watsup:67.1-69.22 - rule rec {C : context, i : nat, st : subtype}: - `%|-%:OK`(C, REC_heaptype(i)) - -- if (C.REC_context[i] = st) + ;; 6-typing.watsup:60.1-61.24 + rule abs {C : context, absheaptype : absheaptype}: + `%|-%:OK`(C, (absheaptype <: heaptype)) ;; 6-typing.watsup:50.1-50.71 relation Reftype_ok: `%|-%:OK`(context, reftype) @@ -1745,24 +1901,24 @@ relation Reftype_ok: `%|-%:OK`(context, reftype) ;; 6-typing.watsup:51.1-51.71 relation Valtype_ok: `%|-%:OK`(context, valtype) - ;; 6-typing.watsup:75.1-77.35 - rule num {C : context, numtype : numtype}: - `%|-%:OK`(C, (numtype <: valtype)) - -- Numtype_ok: `%|-%:OK`(C, numtype) - - ;; 6-typing.watsup:79.1-81.35 - rule vec {C : context, vectype : vectype}: - `%|-%:OK`(C, (vectype <: valtype)) - -- Vectype_ok: `%|-%:OK`(C, vectype) + ;; 6-typing.watsup:87.1-88.16 + rule bot {C : context}: + `%|-%:OK`(C, BOT_valtype) ;; 6-typing.watsup:83.1-85.35 rule ref {C : context, reftype : reftype}: `%|-%:OK`(C, (reftype <: valtype)) -- Reftype_ok: `%|-%:OK`(C, reftype) - ;; 6-typing.watsup:87.1-88.16 - rule bot {C : context}: - `%|-%:OK`(C, BOT_valtype) + ;; 6-typing.watsup:79.1-81.35 + rule vec {C : context, vectype : vectype}: + `%|-%:OK`(C, (vectype <: valtype)) + -- Vectype_ok: `%|-%:OK`(C, vectype) + + ;; 6-typing.watsup:75.1-77.35 + rule num {C : context, numtype : numtype}: + `%|-%:OK`(C, (numtype <: valtype)) + -- Numtype_ok: `%|-%:OK`(C, numtype) ;; 6-typing.watsup:93.1-93.74 relation Resulttype_ok: `%|-%:OK`(context, resulttype) @@ -1796,16 +1952,16 @@ relation Packedtype_ok: `%|-%:OK`(context, packedtype) ;; 6-typing.watsup:114.1-114.77 relation Storagetype_ok: `%|-%:OK`(context, storagetype) - ;; 6-typing.watsup:131.1-133.35 - rule val {C : context, valtype : valtype}: - `%|-%:OK`(C, (valtype <: storagetype)) - -- Valtype_ok: `%|-%:OK`(C, valtype) - ;; 6-typing.watsup:135.1-137.41 rule packed {C : context, packedtype : packedtype}: `%|-%:OK`(C, (packedtype <: storagetype)) -- Packedtype_ok: `%|-%:OK`(C, packedtype) + ;; 6-typing.watsup:131.1-133.35 + rule val {C : context, valtype : valtype}: + `%|-%:OK`(C, (valtype <: storagetype)) + -- Valtype_ok: `%|-%:OK`(C, valtype) + ;; 6-typing.watsup:113.1-113.75 relation Fieldtype_ok: `%|-%:OK`(context, fieldtype) ;; 6-typing.watsup:139.1-141.34 @@ -1823,20 +1979,20 @@ relation Functype_ok: `%|-%:OK`(context, functype) ;; 6-typing.watsup:115.1-115.74 relation Comptype_ok: `%|-%:OK`(context, comptype) - ;; 6-typing.watsup:144.1-146.35 - rule struct {C : context, yt* : fieldtype*}: - `%|-%:OK`(C, STRUCT_comptype(yt*{yt})) - -- (Fieldtype_ok: `%|-%:OK`(C, yt))*{yt} + ;; 6-typing.watsup:152.1-154.31 + rule func {C : context, ft : functype}: + `%|-%:OK`(C, FUNC_comptype(ft)) + -- Functype_ok: `%|-%:OK`(C, ft) ;; 6-typing.watsup:148.1-150.32 rule array {C : context, yt : fieldtype}: `%|-%:OK`(C, ARRAY_comptype(yt)) -- Fieldtype_ok: `%|-%:OK`(C, yt) - ;; 6-typing.watsup:152.1-154.31 - rule func {C : context, ft : functype}: - `%|-%:OK`(C, FUNC_comptype(ft)) - -- Functype_ok: `%|-%:OK`(C, ft) + ;; 6-typing.watsup:144.1-146.35 + rule struct {C : context, yt* : fieldtype*}: + `%|-%:OK`(C, STRUCT_comptype(yt*{yt})) + -- (Fieldtype_ok: `%|-%:OK`(C, yt))*{yt} ;; 6-typing.watsup:391.1-391.91 relation Packedtype_sub: `%|-%<:%`(context, packedtype, packedtype) @@ -1855,113 +2011,113 @@ rec { ;; 6-typing.watsup:125.1-125.75 relation Deftype_sub: `%|-%<:%`(context, deftype, deftype) - ;; 6-typing.watsup:434.1-436.58 - rule refl {C : context, deftype_1 : deftype, deftype_2 : deftype}: - `%|-%<:%`(C, deftype_1, deftype_2) - -- if ($clostype(C, deftype_1) = $clostype(C, deftype_2)) - ;; 6-typing.watsup:438.1-441.40 rule super {C : context, ct : comptype, deftype_1 : deftype, deftype_2 : deftype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*}: `%|-%<:%`(C, deftype_1, deftype_2) -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) -- Heaptype_sub: `%|-%<:%`(C, ht, (deftype_2 <: heaptype)) + ;; 6-typing.watsup:434.1-436.58 + rule refl {C : context, deftype_1 : deftype, deftype_2 : deftype}: + `%|-%<:%`(C, deftype_1, deftype_2) + -- if ($clostype(C, deftype_1) = $clostype(C, deftype_2)) + ;; 6-typing.watsup:271.1-271.79 relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) - ;; 6-typing.watsup:282.1-283.28 - rule refl {C : context, heaptype : heaptype}: - `%|-%<:%`(C, heaptype, heaptype) + ;; 6-typing.watsup:343.1-344.23 + rule bot {C : context, heaptype : heaptype}: + `%|-%<:%`(C, BOT_heaptype, heaptype) - ;; 6-typing.watsup:285.1-289.48 - rule trans {C : context, heaptype' : heaptype, heaptype_1 : heaptype, heaptype_2 : heaptype}: - `%|-%<:%`(C, heaptype_1, heaptype_2) - -- Heaptype_ok: `%|-%:OK`(C, heaptype') - -- Heaptype_sub: `%|-%<:%`(C, heaptype_1, heaptype') - -- Heaptype_sub: `%|-%<:%`(C, heaptype', heaptype_2) + ;; 6-typing.watsup:339.1-341.43 + rule noextern {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NOEXTERN_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, EXTERN_heaptype) - ;; 6-typing.watsup:291.1-292.17 - rule eq-any {C : context}: - `%|-%<:%`(C, EQ_heaptype, ANY_heaptype) + ;; 6-typing.watsup:335.1-337.41 + rule nofunc {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NOFUNC_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, FUNC_heaptype) - ;; 6-typing.watsup:294.1-295.17 - rule i31-eq {C : context}: - `%|-%<:%`(C, I31_heaptype, EQ_heaptype) + ;; 6-typing.watsup:331.1-333.40 + rule none {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NONE_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, ANY_heaptype) - ;; 6-typing.watsup:297.1-298.20 - rule struct-eq {C : context}: - `%|-%<:%`(C, STRUCT_heaptype, EQ_heaptype) + ;; 6-typing.watsup:327.1-329.48 + rule rec {C : context, ct : comptype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*, i : nat}: + `%|-%<:%`(C, REC_heaptype(i), ht) + -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) - ;; 6-typing.watsup:300.1-301.19 - rule array-eq {C : context}: - `%|-%<:%`(C, ARRAY_heaptype, EQ_heaptype) + ;; 6-typing.watsup:323.1-325.52 + rule typeidx-r {C : context, heaptype : heaptype, typeidx : typeidx}: + `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[typeidx] <: heaptype)) - ;; 6-typing.watsup:303.1-305.35 - rule struct {C : context, deftype : deftype, yt* : fieldtype*}: - `%|-%<:%`(C, (deftype <: heaptype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) + ;; 6-typing.watsup:319.1-321.52 + rule typeidx-l {C : context, heaptype : heaptype, typeidx : typeidx}: + `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) + -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[typeidx] <: heaptype), heaptype) - ;; 6-typing.watsup:307.1-309.33 - rule array {C : context, deftype : deftype, yt : fieldtype}: - `%|-%<:%`(C, (deftype <: heaptype), ARRAY_heaptype) - -- Expand: `%~~%`(deftype, ARRAY_comptype(yt)) + ;; 6-typing.watsup:315.1-317.46 + rule def {C : context, deftype_1 : deftype, deftype_2 : deftype}: + `%|-%<:%`(C, (deftype_1 <: heaptype), (deftype_2 <: heaptype)) + -- Deftype_sub: `%|-%<:%`(C, deftype_1, deftype_2) ;; 6-typing.watsup:311.1-313.32 rule func {C : context, deftype : deftype, ft : functype}: `%|-%<:%`(C, (deftype <: heaptype), FUNC_heaptype) -- Expand: `%~~%`(deftype, FUNC_comptype(ft)) - ;; 6-typing.watsup:315.1-317.46 - rule def {C : context, deftype_1 : deftype, deftype_2 : deftype}: - `%|-%<:%`(C, (deftype_1 <: heaptype), (deftype_2 <: heaptype)) - -- Deftype_sub: `%|-%<:%`(C, deftype_1, deftype_2) + ;; 6-typing.watsup:307.1-309.33 + rule array {C : context, deftype : deftype, yt : fieldtype}: + `%|-%<:%`(C, (deftype <: heaptype), ARRAY_heaptype) + -- Expand: `%~~%`(deftype, ARRAY_comptype(yt)) - ;; 6-typing.watsup:319.1-321.52 - rule typeidx-l {C : context, heaptype : heaptype, typeidx : typeidx}: - `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) - -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[typeidx] <: heaptype), heaptype) + ;; 6-typing.watsup:303.1-305.35 + rule struct {C : context, deftype : deftype, yt* : fieldtype*}: + `%|-%<:%`(C, (deftype <: heaptype), STRUCT_heaptype) + -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) - ;; 6-typing.watsup:323.1-325.52 - rule typeidx-r {C : context, heaptype : heaptype, typeidx : typeidx}: - `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[typeidx] <: heaptype)) + ;; 6-typing.watsup:300.1-301.19 + rule array-eq {C : context}: + `%|-%<:%`(C, ARRAY_heaptype, EQ_heaptype) - ;; 6-typing.watsup:327.1-329.48 - rule rec {C : context, ct : comptype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*, i : nat}: - `%|-%<:%`(C, REC_heaptype(i), ht) - -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + ;; 6-typing.watsup:297.1-298.20 + rule struct-eq {C : context}: + `%|-%<:%`(C, STRUCT_heaptype, EQ_heaptype) - ;; 6-typing.watsup:331.1-333.40 - rule none {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NONE_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, ANY_heaptype) + ;; 6-typing.watsup:294.1-295.17 + rule i31-eq {C : context}: + `%|-%<:%`(C, I31_heaptype, EQ_heaptype) - ;; 6-typing.watsup:335.1-337.41 - rule nofunc {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NOFUNC_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, FUNC_heaptype) + ;; 6-typing.watsup:291.1-292.17 + rule eq-any {C : context}: + `%|-%<:%`(C, EQ_heaptype, ANY_heaptype) - ;; 6-typing.watsup:339.1-341.43 - rule noextern {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NOEXTERN_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, EXTERN_heaptype) + ;; 6-typing.watsup:285.1-289.48 + rule trans {C : context, heaptype' : heaptype, heaptype_1 : heaptype, heaptype_2 : heaptype}: + `%|-%<:%`(C, heaptype_1, heaptype_2) + -- Heaptype_ok: `%|-%:OK`(C, heaptype') + -- Heaptype_sub: `%|-%<:%`(C, heaptype_1, heaptype') + -- Heaptype_sub: `%|-%<:%`(C, heaptype', heaptype_2) - ;; 6-typing.watsup:343.1-344.23 - rule bot {C : context, heaptype : heaptype}: - `%|-%<:%`(C, BOT_heaptype, heaptype) + ;; 6-typing.watsup:282.1-283.28 + rule refl {C : context, heaptype : heaptype}: + `%|-%<:%`(C, heaptype, heaptype) } ;; 6-typing.watsup:272.1-272.78 relation Reftype_sub: `%|-%<:%`(context, reftype, reftype) - ;; 6-typing.watsup:347.1-349.37 - rule nonnull {C : context, ht_1 : heaptype, ht_2 : heaptype}: - `%|-%<:%`(C, REF_reftype(`NULL%?`(?()), ht_1), REF_reftype(`NULL%?`(?()), ht_2)) - -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) - ;; 6-typing.watsup:351.1-353.37 rule null {C : context, ht_1 : heaptype, ht_2 : heaptype}: `%|-%<:%`(C, REF_reftype(`NULL%?`(()?{}), ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) + ;; 6-typing.watsup:347.1-349.37 + rule nonnull {C : context, ht_1 : heaptype, ht_2 : heaptype}: + `%|-%<:%`(C, REF_reftype(`NULL%?`(?()), ht_1), REF_reftype(`NULL%?`(?()), ht_2)) + -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) + ;; 6-typing.watsup:270.1-270.78 relation Vectype_sub: `%|-%<:%`(context, vectype, vectype) ;; 6-typing.watsup:278.1-279.26 @@ -1970,50 +2126,50 @@ relation Vectype_sub: `%|-%<:%`(context, vectype, vectype) ;; 6-typing.watsup:273.1-273.78 relation Valtype_sub: `%|-%<:%`(context, valtype, valtype) - ;; 6-typing.watsup:356.1-358.46 - rule num {C : context, numtype_1 : numtype, numtype_2 : numtype}: - `%|-%<:%`(C, (numtype_1 <: valtype), (numtype_2 <: valtype)) - -- Numtype_sub: `%|-%<:%`(C, numtype_1, numtype_2) - - ;; 6-typing.watsup:360.1-362.46 - rule vec {C : context, vectype_1 : vectype, vectype_2 : vectype}: - `%|-%<:%`(C, (vectype_1 <: valtype), (vectype_2 <: valtype)) - -- Vectype_sub: `%|-%<:%`(C, vectype_1, vectype_2) + ;; 6-typing.watsup:368.1-369.22 + rule bot {C : context, valtype : valtype}: + `%|-%<:%`(C, BOT_valtype, valtype) ;; 6-typing.watsup:364.1-366.46 rule ref {C : context, reftype_1 : reftype, reftype_2 : reftype}: `%|-%<:%`(C, (reftype_1 <: valtype), (reftype_2 <: valtype)) -- Reftype_sub: `%|-%<:%`(C, reftype_1, reftype_2) - ;; 6-typing.watsup:368.1-369.22 - rule bot {C : context, valtype : valtype}: - `%|-%<:%`(C, BOT_valtype, valtype) + ;; 6-typing.watsup:360.1-362.46 + rule vec {C : context, vectype_1 : vectype, vectype_2 : vectype}: + `%|-%<:%`(C, (vectype_1 <: valtype), (vectype_2 <: valtype)) + -- Vectype_sub: `%|-%<:%`(C, vectype_1, vectype_2) + + ;; 6-typing.watsup:356.1-358.46 + rule num {C : context, numtype_1 : numtype, numtype_2 : numtype}: + `%|-%<:%`(C, (numtype_1 <: valtype), (numtype_2 <: valtype)) + -- Numtype_sub: `%|-%<:%`(C, numtype_1, numtype_2) ;; 6-typing.watsup:392.1-392.92 relation Storagetype_sub: `%|-%<:%`(context, storagetype, storagetype) - ;; 6-typing.watsup:402.1-404.46 - rule val {C : context, valtype_1 : valtype, valtype_2 : valtype}: - `%|-%<:%`(C, (valtype_1 <: storagetype), (valtype_2 <: storagetype)) - -- Valtype_sub: `%|-%<:%`(C, valtype_1, valtype_2) - ;; 6-typing.watsup:406.1-408.55 rule packed {C : context, packedtype_1 : packedtype, packedtype_2 : packedtype}: `%|-%<:%`(C, (packedtype_1 <: storagetype), (packedtype_2 <: storagetype)) -- Packedtype_sub: `%|-%<:%`(C, packedtype_1, packedtype_2) + ;; 6-typing.watsup:402.1-404.46 + rule val {C : context, valtype_1 : valtype, valtype_2 : valtype}: + `%|-%<:%`(C, (valtype_1 <: storagetype), (valtype_2 <: storagetype)) + -- Valtype_sub: `%|-%<:%`(C, valtype_1, valtype_2) + ;; 6-typing.watsup:393.1-393.90 relation Fieldtype_sub: `%|-%<:%`(context, fieldtype, fieldtype) - ;; 6-typing.watsup:411.1-413.40 - rule const {C : context, zt_1 : storagetype, zt_2 : storagetype}: - `%|-%<:%`(C, `%%`(`MUT%?`(?()), zt_1), `%%`(`MUT%?`(?()), zt_2)) - -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) - ;; 6-typing.watsup:415.1-418.40 rule var {C : context, zt_1 : storagetype, zt_2 : storagetype}: `%|-%<:%`(C, `%%`(`MUT%?`(?(())), zt_1), `%%`(`MUT%?`(?(())), zt_2)) -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) + ;; 6-typing.watsup:411.1-413.40 + rule const {C : context, zt_1 : storagetype, zt_2 : storagetype}: + `%|-%<:%`(C, `%%`(`MUT%?`(?()), zt_1), `%%`(`MUT%?`(?()), zt_2)) + -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) + ;; 6-typing.watsup:395.1-395.89 relation Functype_sub: `%|-%<:%`(context, functype, functype) ;; 6-typing.watsup:458.1-459.16 @@ -2022,20 +2178,20 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) ;; 6-typing.watsup:124.1-124.76 relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) - ;; 6-typing.watsup:421.1-423.41 - rule struct {C : context, yt'_1 : fieldtype, yt_1* : fieldtype*, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) - -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} + ;; 6-typing.watsup:429.1-431.37 + rule func {C : context, ft_1 : functype, ft_2 : functype}: + `%|-%<:%`(C, FUNC_comptype(ft_1), FUNC_comptype(ft_2)) + -- Functype_sub: `%|-%<:%`(C, ft_1, ft_2) ;; 6-typing.watsup:425.1-427.38 rule array {C : context, yt_1 : fieldtype, yt_2 : fieldtype}: `%|-%<:%`(C, ARRAY_comptype(yt_1), ARRAY_comptype(yt_2)) -- Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2) - ;; 6-typing.watsup:429.1-431.37 - rule func {C : context, ft_1 : functype, ft_2 : functype}: - `%|-%<:%`(C, FUNC_comptype(ft_1), FUNC_comptype(ft_2)) - -- Functype_sub: `%|-%<:%`(C, ft_1, ft_2) + ;; 6-typing.watsup:421.1-423.41 + rule struct {C : context, yt'_1 : fieldtype, yt_1* : fieldtype*, yt_2* : fieldtype*}: + `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) + -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} ;; 6-typing.watsup:117.1-117.73 relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) @@ -2050,21 +2206,21 @@ relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) ;; 6-typing.watsup:165.1-165.65 def before : (heaptype, typeidx, nat) -> bool - ;; 6-typing.watsup:166.1-166.34 - def {deftype : deftype, i : nat, x : idx} before((deftype <: heaptype), x, i) = true - ;; 6-typing.watsup:167.1-167.46 - def {i : nat, typeidx : typeidx, x : idx} before(_IDX_heaptype(typeidx), x, i) = (typeidx < x) ;; 6-typing.watsup:168.1-168.33 def {i : nat, j : nat, x : idx} before(REC_heaptype(j), x, i) = (j < i) + ;; 6-typing.watsup:167.1-167.46 + def {i : nat, typeidx : typeidx, x : idx} before(_IDX_heaptype(typeidx), x, i) = (typeidx < x) + ;; 6-typing.watsup:166.1-166.34 + def {deftype : deftype, i : nat, x : idx} before((deftype <: heaptype), x, i) = true ;; 6-typing.watsup:170.1-170.69 def unrollht : (context, heaptype) -> subtype - ;; 6-typing.watsup:171.1-171.47 - def {C : context, deftype : deftype} unrollht(C, (deftype <: heaptype)) = $unrolldt(deftype) - ;; 6-typing.watsup:172.1-172.60 - def {C : context, typeidx : typeidx} unrollht(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx]) ;; 6-typing.watsup:173.1-173.35 def {C : context, i : nat} unrollht(C, REC_heaptype(i)) = C.REC_context[i] + ;; 6-typing.watsup:172.1-172.60 + def {C : context, typeidx : typeidx} unrollht(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx]) + ;; 6-typing.watsup:171.1-171.47 + def {C : context, deftype : deftype} unrollht(C, (deftype <: heaptype)) = $unrolldt(deftype) ;; 6-typing.watsup:119.1-119.76 relation Subtype_ok2: `%|-%:%`(context, subtype, oktypeidxnat) @@ -2082,15 +2238,15 @@ rec { ;; 6-typing.watsup:120.1-120.76 relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) - ;; 6-typing.watsup:196.1-197.24 - rule empty {C : context, i : nat, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) - ;; 6-typing.watsup:199.1-202.50 rule cons {C : context, i : nat, st* : subtype*, st_1 : subtype, x : idx}: `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidxnat((x + 1), (i + 1))) + + ;; 6-typing.watsup:196.1-197.24 + rule empty {C : context, i : nat, x : idx}: + `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) } ;; 6-typing.watsup:118.1-118.74 @@ -2098,9 +2254,10 @@ rec { ;; 6-typing.watsup:118.1-118.74 relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) - ;; 6-typing.watsup:184.1-185.23 - rule empty {C : context, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) + ;; 6-typing.watsup:192.1-194.49 + rule rec2 {C : context, st* : subtype*, x : idx}: + `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) ;; 6-typing.watsup:187.1-190.43 rule cons {C : context, st* : subtype*, st_1 : subtype, x : idx}: @@ -2108,10 +2265,9 @@ relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x + 1)) - ;; 6-typing.watsup:192.1-194.49 - rule rec2 {C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) + ;; 6-typing.watsup:184.1-185.23 + rule empty {C : context, x : idx}: + `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) } ;; 6-typing.watsup:121.1-121.73 @@ -2154,26 +2310,26 @@ relation Memtype_ok: `%|-%:OK`(context, memtype) ;; 6-typing.watsup:218.1-218.74 relation Externtype_ok: `%|-%:OK`(context, externtype) - ;; 6-typing.watsup:244.1-247.27 - rule func {C : context, dt : deftype, ft : functype}: - `%|-%:OK`(C, FUNC_externtype(dt)) - -- Deftype_ok: `%|-%:OK`(C, dt) - -- Expand: `%~~%`(dt, FUNC_comptype(ft)) - - ;; 6-typing.watsup:249.1-251.33 - rule global {C : context, gt : globaltype}: - `%|-%:OK`(C, GLOBAL_externtype(gt)) - -- Globaltype_ok: `%|-%:OK`(C, gt) + ;; 6-typing.watsup:257.1-259.30 + rule mem {C : context, mt : memtype}: + `%|-%:OK`(C, MEM_externtype(mt)) + -- Memtype_ok: `%|-%:OK`(C, mt) ;; 6-typing.watsup:253.1-255.32 rule table {C : context, tt : tabletype}: `%|-%:OK`(C, TABLE_externtype(tt)) -- Tabletype_ok: `%|-%:OK`(C, tt) - ;; 6-typing.watsup:257.1-259.30 - rule mem {C : context, mt : memtype}: - `%|-%:OK`(C, MEM_externtype(mt)) - -- Memtype_ok: `%|-%:OK`(C, mt) + ;; 6-typing.watsup:249.1-251.33 + rule global {C : context, gt : globaltype}: + `%|-%:OK`(C, GLOBAL_externtype(gt)) + -- Globaltype_ok: `%|-%:OK`(C, gt) + + ;; 6-typing.watsup:244.1-247.27 + rule func {C : context, dt : deftype, ft : functype}: + `%|-%:OK`(C, FUNC_externtype(dt)) + -- Deftype_ok: `%|-%:OK`(C, dt) + -- Expand: `%~~%`(dt, FUNC_comptype(ft)) ;; 6-typing.watsup:374.1-374.81 relation Resulttype_sub: `%|-%*<:%*`(context, valtype*, valtype*) @@ -2202,17 +2358,17 @@ relation Limits_sub: `%|-%<:%`(context, limits, limits) ;; 6-typing.watsup:447.1-447.83 relation Globaltype_sub: `%|-%<:%`(context, globaltype, globaltype) - ;; 6-typing.watsup:461.1-463.34 - rule const {C : context, t_1 : valtype, t_2 : valtype}: - `%|-%<:%`(C, `%%`(`MUT%?`(?()), t_1), `%%`(`MUT%?`(?()), t_2)) - -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) - ;; 6-typing.watsup:465.1-468.34 rule var {C : context, t_1 : valtype, t_2 : valtype}: `%|-%<:%`(C, `%%`(`MUT%?`(?(())), t_1), `%%`(`MUT%?`(?(())), t_2)) -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) -- Valtype_sub: `%|-%<:%`(C, t_2, t_1) + ;; 6-typing.watsup:461.1-463.34 + rule const {C : context, t_1 : valtype, t_2 : valtype}: + `%|-%<:%`(C, `%%`(`MUT%?`(?()), t_1), `%%`(`MUT%?`(?()), t_2)) + -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) + ;; 6-typing.watsup:448.1-448.82 relation Tabletype_sub: `%|-%<:%`(context, tabletype, tabletype) ;; 6-typing.watsup:470.1-474.36 @@ -2231,253 +2387,258 @@ relation Memtype_sub: `%|-%<:%`(context, memtype, memtype) ;; 6-typing.watsup:450.1-450.83 relation Externtype_sub: `%|-%<:%`(context, externtype, externtype) - ;; 6-typing.watsup:481.1-483.36 - rule func {C : context, dt_1 : deftype, dt_2 : deftype}: - `%|-%<:%`(C, FUNC_externtype(dt_1), FUNC_externtype(dt_2)) - -- Deftype_sub: `%|-%<:%`(C, dt_1, dt_2) - - ;; 6-typing.watsup:485.1-487.39 - rule global {C : context, gt_1 : globaltype, gt_2 : globaltype}: - `%|-%<:%`(C, GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) - -- Globaltype_sub: `%|-%<:%`(C, gt_1, gt_2) + ;; 6-typing.watsup:493.1-495.36 + rule mem {C : context, mt_1 : memtype, mt_2 : memtype}: + `%|-%<:%`(C, MEM_externtype(mt_1), MEM_externtype(mt_2)) + -- Memtype_sub: `%|-%<:%`(C, mt_1, mt_2) ;; 6-typing.watsup:489.1-491.38 rule table {C : context, tt_1 : tabletype, tt_2 : tabletype}: `%|-%<:%`(C, TABLE_externtype(tt_1), TABLE_externtype(tt_2)) -- Tabletype_sub: `%|-%<:%`(C, tt_1, tt_2) - ;; 6-typing.watsup:493.1-495.36 - rule mem {C : context, mt_1 : memtype, mt_2 : memtype}: - `%|-%<:%`(C, MEM_externtype(mt_1), MEM_externtype(mt_2)) - -- Memtype_sub: `%|-%<:%`(C, mt_1, mt_2) + ;; 6-typing.watsup:485.1-487.39 + rule global {C : context, gt_1 : globaltype, gt_2 : globaltype}: + `%|-%<:%`(C, GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) + -- Globaltype_sub: `%|-%<:%`(C, gt_1, gt_2) + + ;; 6-typing.watsup:481.1-483.36 + rule func {C : context, dt_1 : deftype, dt_2 : deftype}: + `%|-%<:%`(C, FUNC_externtype(dt_1), FUNC_externtype(dt_2)) + -- Deftype_sub: `%|-%<:%`(C, dt_1, dt_2) ;; 6-typing.watsup:565.1-565.76 relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) - ;; 6-typing.watsup:567.1-568.32 - rule void {C : context}: - `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) + ;; 6-typing.watsup:573.1-575.34 + rule typeidx {C : context, ft : functype, x : idx}: + `%|-%:%`(C, _IDX_blocktype(x), ft) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(ft)) ;; 6-typing.watsup:570.1-571.28 rule result {C : context, t : valtype}: `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`([], [t])) - ;; 6-typing.watsup:573.1-575.34 - rule typeidx {C : context, ft : functype, x : idx}: - `%|-%:%`(C, _IDX_blocktype(x), ft) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(ft)) + ;; 6-typing.watsup:567.1-568.32 + rule void {C : context}: + `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) ;; 6-typing.watsup:503.1-505.74 rec { ;; 6-typing.watsup:503.1-503.67 relation Instr_ok: `%|-%:%`(context, instr, functype) - ;; 6-typing.watsup:544.1-545.34 - rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + ;; 6-typing.watsup:951.1-956.29 + rule store {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, x : idx}: + `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype (nt <: valtype)], [])) + -- if (C.MEM_context[x] = mt) + -- if ((2 ^ n_A) <= ($size(nt <: valtype) / 8)) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt <: valtype) / 8))))?{n} + -- if ((n?{n} = ?()) \/ (nt = (inn <: numtype))) - ;; 6-typing.watsup:547.1-548.24 - rule nop {C : context}: - `%|-%:%`(C, NOP_instr, `%->%`([], [])) + ;; 6-typing.watsup:944.1-949.29 + rule load {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, x : idx}: + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [(nt <: valtype)])) + -- if (C.MEM_context[x] = mt) + -- if ((2 ^ n_A) <= ($size(nt <: valtype) / 8)) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt <: valtype) / 8))))?{n} + -- if ((n?{n} = ?()) \/ (nt = (inn <: numtype))) - ;; 6-typing.watsup:550.1-551.23 - rule drop {C : context, t : valtype}: - `%|-%:%`(C, DROP_instr, `%->%`([t], [])) + ;; 6-typing.watsup:940.1-942.23 + rule data.drop {C : context, x : idx}: + `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) + -- if (C.DATA_context[x] = OK) - ;; 6-typing.watsup:554.1-555.31 - rule select-expl {C : context, t : valtype}: - `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) + ;; 6-typing.watsup:935.1-938.23 + rule memory.init {C : context, mt : memtype, x : idx, y : idx}: + `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x] = mt) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:557.1-560.37 - rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: - `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) - -- Valtype_sub: `%|-%<:%`(C, t, t') - -- if ((t' = (numtype <: valtype)) \/ (t' = (vectype <: valtype))) + ;; 6-typing.watsup:930.1-933.26 + rule memory.copy {C : context, mt_1 : memtype, mt_2 : memtype, x_1 : idx, x_2 : idx}: + `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x_1] = mt_1) + -- if (C.MEM_context[x_2] = mt_2) - ;; 6-typing.watsup:578.1-581.61 - rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:926.1-928.22 + rule memory.fill {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:583.1-586.61 - rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:922.1-924.22 + rule memory.grow {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:588.1-592.65 - rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: - `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) + ;; 6-typing.watsup:918.1-920.22 + rule memory.size {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:597.1-599.24 - rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.LABEL_context[l] = t*{t}) + ;; 6-typing.watsup:911.1-913.23 + rule elem.drop {C : context, rt : reftype, x : idx}: + `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) + -- if (C.ELEM_context[x] = rt) - ;; 6-typing.watsup:601.1-603.24 - rule br_if {C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) - -- if (C.LABEL_context[l] = t*{t}) + ;; 6-typing.watsup:905.1-909.36 + rule table.init {C : context, lim : limits, rt_1 : reftype, rt_2 : reftype, x : idx, y : idx}: + `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.TABLE_context[x] = `%%`(lim, rt_1)) + -- if (C.ELEM_context[y] = rt_2) + -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - ;; 6-typing.watsup:605.1-608.44 - rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- (Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l]))*{l} - -- Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l']) + ;; 6-typing.watsup:899.1-903.36 + rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt_1 : reftype, rt_2 : reftype, x_1 : idx, x_2 : idx}: + `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt_1)) + -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt_2)) + -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - ;; 6-typing.watsup:610.1-613.31 - rule br_on_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[l] = t*{t}) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:895.1-897.28 + rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype (rt <: valtype) I32_valtype], [])) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:615.1-618.31 - rule br_on_non_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) - -- if (C.LABEL_context[l] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:891.1-893.28 + rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([(rt <: valtype) I32_valtype], [I32_valtype])) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:620.1-626.34 - rule br_on_cast {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 <: valtype)], t*{t} :: [($diffrt(rt_1, rt_2) <: valtype)])) - -- if (C.LABEL_context[l] = t*{t} :: [(rt <: valtype)]) - -- Reftype_ok: `%|-%:OK`(C, rt_1) - -- Reftype_ok: `%|-%:OK`(C, rt_2) - -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) + ;; 6-typing.watsup:887.1-889.24 + rule table.size {C : context, tt : tabletype, x : idx}: + `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) + -- if (C.TABLE_context[x] = tt) - ;; 6-typing.watsup:628.1-634.49 - rule br_on_cast_fail {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 <: valtype)], t*{t} :: [(rt_2 <: valtype)])) - -- if (C.LABEL_context[l] = t*{t} :: [(rt <: valtype)]) - -- Reftype_ok: `%|-%:OK`(C, rt_1) - -- Reftype_ok: `%|-%:OK`(C, rt_2) - -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) + ;; 6-typing.watsup:883.1-885.28 + rule table.set {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype (rt <: valtype)], [])) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:639.1-641.24 - rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.RETURN_context = ?(t*{t})) + ;; 6-typing.watsup:879.1-881.28 + rule table.get {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [(rt <: valtype)])) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:643.1-645.46 - rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + ;; 6-typing.watsup:872.1-874.28 + rule global.set {C : context, t : valtype, x : idx}: + `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) + -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?(())), t)) - ;; 6-typing.watsup:647.1-649.46 - rule call_ref {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype))], t_2*{t_2})) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + ;; 6-typing.watsup:868.1-870.28 + rule global.get {C : context, mut : mut, t : valtype, x : idx}: + `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) + -- if (C.GLOBAL_context[x] = `%%`(mut, t)) - ;; 6-typing.watsup:651.1-655.46 - rule call_indirect {C : context, lim : limits, rt : reftype, t_1* : valtype*, t_2* : valtype*, x : idx, y : idx}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + ;; 6-typing.watsup:853.1-855.28 + rule local.get {C : context, init : init, t : valtype, x : idx}: + `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) + -- if (C.LOCAL_context[x] = `%%`(init, t)) - ;; 6-typing.watsup:657.1-661.40 - rule return_call {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) - -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + ;; 6-typing.watsup:847.1-848.62 + rule any.convert_extern {C : context, nul : nul}: + `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) - ;; 6-typing.watsup:663.1-667.40 - rule return_call_ref {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype))], t_4*{t_4})) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + ;; 6-typing.watsup:844.1-845.62 + rule extern.convert_any {C : context, nul : nul}: + `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) - ;; 6-typing.watsup:669.1-675.40 - rule return_call_indirect {C : context, lim : limits, rt : reftype, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx, y : idx}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + ;; 6-typing.watsup:835.1-839.23 + rule array.init_data {C : context, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- if ((t = (numtype <: valtype)) \/ (t = (vectype <: valtype))) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:680.1-681.33 - rule const {C : context, c_nt : c, nt : numtype}: - `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [(nt <: valtype)])) + ;; 6-typing.watsup:830.1-833.43 + rule array.init_elem {C : context, x : idx, y : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- Storagetype_sub: `%|-%<:%`(C, (C.ELEM_context[y] <: storagetype), zt) - ;; 6-typing.watsup:683.1-684.31 - rule unop {C : context, nt : numtype, unop : unop_numtype}: - `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([(nt <: valtype)], [(nt <: valtype)])) + ;; 6-typing.watsup:824.1-828.40 + rule array.copy {C : context, mut : mut, x_1 : idx, x_2 : idx, zt_1 : storagetype, zt_2 : storagetype}: + `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) <: heaptype)) I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x_1], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) + -- Expand: `%~~%`(C.TYPE_context[x_2], ARRAY_comptype(`%%`(mut, zt_2))) + -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) - ;; 6-typing.watsup:686.1-687.36 - rule binop {C : context, binop : binop_numtype, nt : numtype}: - `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([(nt <: valtype) (nt <: valtype)], [(nt <: valtype)])) + ;; 6-typing.watsup:820.1-822.41 + rule array.fill {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype $unpacktype(zt) I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:689.1-690.36 - rule testop {C : context, nt : numtype, testop : testop_numtype}: - `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([(nt <: valtype)], [I32_valtype])) + ;; 6-typing.watsup:816.1-818.41 + rule array.len {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:692.1-693.37 - rule relop {C : context, nt : numtype, relop : relop_numtype}: - `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([(nt <: valtype) (nt <: valtype)], [I32_valtype])) + ;; 6-typing.watsup:812.1-814.41 + rule array.set {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype $unpacktype(zt)], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:696.1-698.23 - rule extend {C : context, n : n, nt : numtype}: - `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([(nt <: valtype)], [(nt <: valtype)])) - -- if (n <= $size(nt <: valtype)) + ;; 6-typing.watsup:807.1-810.43 + rule array.get {C : context, mut : mut, sx? : sx?, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype], [$unpacktype(zt)])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- if ((sx?{sx} = ?()) <=> (zt = ($unpacktype(zt) <: storagetype))) - ;; 6-typing.watsup:700.1-703.34 - rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([(nt_2 <: valtype)], [(nt_1 <: valtype)])) - -- if (nt_1 =/= nt_2) - -- if ($size(nt_1 <: valtype) = $size(nt_2 <: valtype)) + ;; 6-typing.watsup:801.1-805.23 + rule array.new_data {C : context, mut : mut, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx}: + `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, (t <: storagetype)))) + -- if ((t = (numtype <: valtype)) \/ (t = (vectype <: valtype))) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:705.1-708.50 - rule convert-i {C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr((inn_1 <: numtype), CONVERT_cvtop, (inn_2 <: numtype), sx?{sx}), `%->%`([(inn_2 <: valtype)], [(inn_1 <: valtype)])) - -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> ($size(inn_1 <: valtype) > $size(inn_2 <: valtype))) + ;; 6-typing.watsup:796.1-799.39 + rule array.new_elem {C : context, mut : mut, rt : reftype, x : idx, y : idx}: + `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, (rt <: storagetype)))) + -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y], rt) - ;; 6-typing.watsup:710.1-712.24 - rule convert-f {C : context, fnn_1 : fnn, fnn_2 : fnn}: - `%|-%:%`(C, CVTOP_instr((fnn_1 <: numtype), CONVERT_cvtop, (fnn_2 <: numtype), ?()), `%->%`([(fnn_2 <: valtype)], [(fnn_1 <: valtype)])) - -- if (fnn_1 =/= fnn_2) + ;; 6-typing.watsup:792.1-794.41 + rule array.new_fixed {C : context, mut : mut, n : n, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpacktype(zt)], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - ;; 6-typing.watsup:717.1-719.31 - rule ref.null {C : context, ht : heaptype}: - `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:787.1-790.40 + rule array.new_default {C : context, mut : mut, val : val, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- if ($default($unpacktype(zt)) = ?(val)) - ;; 6-typing.watsup:722.1-724.23 - rule ref.func {C : context, dt : deftype, epsilon : resulttype, x : idx}: - `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), (dt <: heaptype))])) - -- if (C.FUNC_context[x] = dt) + ;; 6-typing.watsup:783.1-785.41 + rule array.new {C : context, mut : mut, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpacktype(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - ;; 6-typing.watsup:726.1-727.34 - rule ref.i31 {C : context}: - `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) + ;; 6-typing.watsup:775.1-778.24 + rule struct.set {C : context, i : nat, x : idx, yt* : fieldtype*, zt : storagetype}: + `%|-%:%`(C, STRUCT.SET_instr(x, i), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) $unpacktype(zt)], [])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) + -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) - ;; 6-typing.watsup:729.1-730.31 - rule ref.is_null {C : context, rt : reftype}: - `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([(rt <: valtype)], [I32_valtype])) + ;; 6-typing.watsup:769.1-773.43 + rule struct.get {C : context, i : nat, mut : mut, sx? : sx?, x : idx, yt* : fieldtype*, zt : storagetype}: + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx}, x, i), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype))], [$unpacktype(zt)])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) + -- if (yt*{yt}[i] = `%%`(mut, zt)) + -- if ((sx?{sx} = ?()) <=> (zt = ($unpacktype(zt) <: storagetype))) - ;; 6-typing.watsup:732.1-734.31 - rule ref.as_non_null {C : context, ht : heaptype}: - `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:764.1-767.43 + rule struct.new_default {C : context, mut* : mut*, val* : val*, x : idx, zt* : storagetype*}: + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} - ;; 6-typing.watsup:736.1-737.51 - rule ref.eq {C : context}: - `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) + ;; 6-typing.watsup:760.1-762.43 + rule struct.new {C : context, mut* : mut*, x : idx, zt* : storagetype*}: + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - ;; 6-typing.watsup:739.1-743.33 - rule ref.test {C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([(rt' <: valtype)], [I32_valtype])) - -- Reftype_ok: `%|-%:OK`(C, rt) - -- Reftype_ok: `%|-%:OK`(C, rt') - -- Reftype_sub: `%|-%<:%`(C, rt, rt') + ;; 6-typing.watsup:754.1-755.42 + rule i31.get {C : context, sx : sx}: + `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) ;; 6-typing.watsup:745.1-749.33 rule ref.cast {C : context, rt : reftype, rt' : reftype}: @@ -2486,241 +2647,243 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- Reftype_ok: `%|-%:OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:754.1-755.42 - rule i31.get {C : context, sx : sx}: - `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) + ;; 6-typing.watsup:739.1-743.33 + rule ref.test {C : context, rt : reftype, rt' : reftype}: + `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([(rt' <: valtype)], [I32_valtype])) + -- Reftype_ok: `%|-%:OK`(C, rt) + -- Reftype_ok: `%|-%:OK`(C, rt') + -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:760.1-762.43 - rule struct.new {C : context, mut* : mut*, x : idx, zt* : storagetype*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + ;; 6-typing.watsup:736.1-737.51 + rule ref.eq {C : context}: + `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) - ;; 6-typing.watsup:764.1-767.43 - rule struct.new_default {C : context, mut* : mut*, val* : val*, x : idx, zt* : storagetype*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} + ;; 6-typing.watsup:732.1-734.31 + rule ref.as_non_null {C : context, ht : heaptype}: + `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:769.1-773.43 - rule struct.get {C : context, i : nat, mut : mut, sx? : sx?, x : idx, yt* : fieldtype*, zt : storagetype}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx}, x, i), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype))], [$unpacktype(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(mut, zt)) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpacktype(zt) <: storagetype))) + ;; 6-typing.watsup:729.1-730.31 + rule ref.is_null {C : context, rt : reftype}: + `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([(rt <: valtype)], [I32_valtype])) - ;; 6-typing.watsup:775.1-778.24 - rule struct.set {C : context, i : nat, x : idx, yt* : fieldtype*, zt : storagetype}: - `%|-%:%`(C, STRUCT.SET_instr(x, i), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) $unpacktype(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) + ;; 6-typing.watsup:726.1-727.34 + rule ref.i31 {C : context}: + `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) - ;; 6-typing.watsup:783.1-785.41 - rule array.new {C : context, mut : mut, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpacktype(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + ;; 6-typing.watsup:722.1-724.23 + rule ref.func {C : context, dt : deftype, epsilon : resulttype, x : idx}: + `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), (dt <: heaptype))])) + -- if (C.FUNC_context[x] = dt) - ;; 6-typing.watsup:787.1-790.40 - rule array.new_default {C : context, mut : mut, val : val, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - -- if ($default($unpacktype(zt)) = ?(val)) + ;; 6-typing.watsup:717.1-719.31 + rule ref.null {C : context, ht : heaptype}: + `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:792.1-794.41 - rule array.new_fixed {C : context, mut : mut, n : n, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpacktype(zt)], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + ;; 6-typing.watsup:710.1-712.24 + rule convert-f {C : context, fnn_1 : fnn, fnn_2 : fnn}: + `%|-%:%`(C, CVTOP_instr((fnn_1 <: numtype), CONVERT_cvtop, (fnn_2 <: numtype), ?()), `%->%`([(fnn_2 <: valtype)], [(fnn_1 <: valtype)])) + -- if (fnn_1 =/= fnn_2) - ;; 6-typing.watsup:796.1-799.39 - rule array.new_elem {C : context, mut : mut, rt : reftype, x : idx, y : idx}: - `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, (rt <: storagetype)))) - -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y], rt) + ;; 6-typing.watsup:705.1-708.50 + rule convert-i {C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: + `%|-%:%`(C, CVTOP_instr((inn_1 <: numtype), CONVERT_cvtop, (inn_2 <: numtype), sx?{sx}), `%->%`([(inn_2 <: valtype)], [(inn_1 <: valtype)])) + -- if (inn_1 =/= inn_2) + -- if ((sx?{sx} = ?()) <=> ($size(inn_1 <: valtype) > $size(inn_2 <: valtype))) - ;; 6-typing.watsup:801.1-805.23 - rule array.new_data {C : context, mut : mut, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx}: - `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, (t <: storagetype)))) - -- if ((t = (numtype <: valtype)) \/ (t = (vectype <: valtype))) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:700.1-703.34 + rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype}: + `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([(nt_2 <: valtype)], [(nt_1 <: valtype)])) + -- if (nt_1 =/= nt_2) + -- if ($size(nt_1 <: valtype) = $size(nt_2 <: valtype)) - ;; 6-typing.watsup:807.1-810.43 - rule array.get {C : context, mut : mut, sx? : sx?, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype], [$unpacktype(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpacktype(zt) <: storagetype))) + ;; 6-typing.watsup:696.1-698.23 + rule extend {C : context, n : n, nt : numtype}: + `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([(nt <: valtype)], [(nt <: valtype)])) + -- if (n <= $size(nt <: valtype)) - ;; 6-typing.watsup:812.1-814.41 - rule array.set {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype $unpacktype(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:692.1-693.37 + rule relop {C : context, nt : numtype, relop : relop_numtype}: + `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([(nt <: valtype) (nt <: valtype)], [I32_valtype])) - ;; 6-typing.watsup:816.1-818.41 - rule array.len {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:689.1-690.36 + rule testop {C : context, nt : numtype, testop : testop_numtype}: + `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([(nt <: valtype)], [I32_valtype])) - ;; 6-typing.watsup:820.1-822.41 - rule array.fill {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype $unpacktype(zt) I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:686.1-687.36 + rule binop {C : context, binop : binop_numtype, nt : numtype}: + `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([(nt <: valtype) (nt <: valtype)], [(nt <: valtype)])) - ;; 6-typing.watsup:824.1-828.40 - rule array.copy {C : context, mut : mut, x_1 : idx, x_2 : idx, zt_1 : storagetype, zt_2 : storagetype}: - `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) <: heaptype)) I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x_1], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) - -- Expand: `%~~%`(C.TYPE_context[x_2], ARRAY_comptype(`%%`(mut, zt_2))) - -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) + ;; 6-typing.watsup:683.1-684.31 + rule unop {C : context, nt : numtype, unop : unop_numtype}: + `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([(nt <: valtype)], [(nt <: valtype)])) - ;; 6-typing.watsup:830.1-833.43 - rule array.init_elem {C : context, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- Storagetype_sub: `%|-%<:%`(C, (C.ELEM_context[y] <: storagetype), zt) + ;; 6-typing.watsup:680.1-681.33 + rule const {C : context, c_nt : c, nt : numtype}: + `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [(nt <: valtype)])) - ;; 6-typing.watsup:835.1-839.23 - rule array.init_data {C : context, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- if ((t = (numtype <: valtype)) \/ (t = (vectype <: valtype))) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:669.1-675.40 + rule return_call_indirect {C : context, lim : limits, rt : reftype, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx, y : idx}: + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) + -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:844.1-845.62 - rule extern.convert_any {C : context, nul : nul}: - `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) + ;; 6-typing.watsup:663.1-667.40 + rule return_call_ref {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype))], t_4*{t_4})) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:847.1-848.62 - rule any.convert_extern {C : context, nul : nul}: - `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) + ;; 6-typing.watsup:657.1-661.40 + rule return_call {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) + -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:853.1-855.28 - rule local.get {C : context, init : init, t : valtype, x : idx}: - `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) - -- if (C.LOCAL_context[x] = `%%`(init, t)) + ;; 6-typing.watsup:651.1-655.46 + rule call_indirect {C : context, lim : limits, rt : reftype, t_1* : valtype*, t_2* : valtype*, x : idx, y : idx}: + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) + -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:868.1-870.28 - rule global.get {C : context, mut : mut, t : valtype, x : idx}: - `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) - -- if (C.GLOBAL_context[x] = `%%`(mut, t)) + ;; 6-typing.watsup:647.1-649.46 + rule call_ref {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype))], t_2*{t_2})) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:872.1-874.28 - rule global.set {C : context, t : valtype, x : idx}: - `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) - -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?(())), t)) + ;; 6-typing.watsup:643.1-645.46 + rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: + `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:879.1-881.28 - rule table.get {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [(rt <: valtype)])) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:639.1-641.24 + rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- if (C.RETURN_context = ?(t*{t})) - ;; 6-typing.watsup:883.1-885.28 - rule table.set {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype (rt <: valtype)], [])) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:628.1-634.49 + rule br_on_cast_fail {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 <: valtype)], t*{t} :: [(rt_2 <: valtype)])) + -- if (C.LABEL_context[l] = t*{t} :: [(rt <: valtype)]) + -- Reftype_ok: `%|-%:OK`(C, rt_1) + -- Reftype_ok: `%|-%:OK`(C, rt_2) + -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) - ;; 6-typing.watsup:887.1-889.24 - rule table.size {C : context, tt : tabletype, x : idx}: - `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) - -- if (C.TABLE_context[x] = tt) + ;; 6-typing.watsup:620.1-626.34 + rule br_on_cast {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 <: valtype)], t*{t} :: [($diffrt(rt_1, rt_2) <: valtype)])) + -- if (C.LABEL_context[l] = t*{t} :: [(rt <: valtype)]) + -- Reftype_ok: `%|-%:OK`(C, rt_1) + -- Reftype_ok: `%|-%:OK`(C, rt_2) + -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) - ;; 6-typing.watsup:891.1-893.28 - rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([(rt <: valtype) I32_valtype], [I32_valtype])) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:615.1-618.31 + rule br_on_non_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) + -- if (C.LABEL_context[l] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:895.1-897.28 - rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype (rt <: valtype) I32_valtype], [])) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:610.1-613.31 + rule br_on_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) + -- if (C.LABEL_context[l] = t*{t}) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:899.1-903.36 - rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt_1 : reftype, rt_2 : reftype, x_1 : idx, x_2 : idx}: - `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt_1)) - -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt_2)) - -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + ;; 6-typing.watsup:605.1-608.44 + rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- (Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l]))*{l} + -- Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l']) - ;; 6-typing.watsup:905.1-909.36 - rule table.init {C : context, lim : limits, rt_1 : reftype, rt_2 : reftype, x : idx, y : idx}: - `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.TABLE_context[x] = `%%`(lim, rt_1)) - -- if (C.ELEM_context[y] = rt_2) - -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + ;; 6-typing.watsup:601.1-603.24 + rule br_if {C : context, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) + -- if (C.LABEL_context[l] = t*{t}) - ;; 6-typing.watsup:911.1-913.23 - rule elem.drop {C : context, rt : reftype, x : idx}: - `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) - -- if (C.ELEM_context[x] = rt) + ;; 6-typing.watsup:597.1-599.24 + rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- if (C.LABEL_context[l] = t*{t}) - ;; 6-typing.watsup:918.1-920.22 - rule memory.size {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:588.1-592.65 + rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) - ;; 6-typing.watsup:922.1-924.22 - rule memory.grow {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:583.1-586.61 + rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - ;; 6-typing.watsup:926.1-928.22 - rule memory.fill {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:578.1-581.61 + rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - ;; 6-typing.watsup:930.1-933.26 - rule memory.copy {C : context, mt_1 : memtype, mt_2 : memtype, x_1 : idx, x_2 : idx}: - `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x_1] = mt_1) - -- if (C.MEM_context[x_2] = mt_2) + ;; 6-typing.watsup:557.1-560.37 + rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: + `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) + -- Valtype_sub: `%|-%<:%`(C, t, t') + -- if ((t' = (numtype <: valtype)) \/ (t' = (vectype <: valtype))) - ;; 6-typing.watsup:935.1-938.23 - rule memory.init {C : context, mt : memtype, x : idx, y : idx}: - `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x] = mt) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:554.1-555.31 + rule select-expl {C : context, t : valtype}: + `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) - ;; 6-typing.watsup:940.1-942.23 - rule data.drop {C : context, x : idx}: - `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) - -- if (C.DATA_context[x] = OK) + ;; 6-typing.watsup:550.1-551.23 + rule drop {C : context, t : valtype}: + `%|-%:%`(C, DROP_instr, `%->%`([t], [])) - ;; 6-typing.watsup:944.1-949.29 - rule load {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, x : idx}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [(nt <: valtype)])) - -- if (C.MEM_context[x] = mt) - -- if ((2 ^ n_A) <= ($size(nt <: valtype) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt <: valtype) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn <: numtype))) + ;; 6-typing.watsup:547.1-548.24 + rule nop {C : context}: + `%|-%:%`(C, NOP_instr, `%->%`([], [])) - ;; 6-typing.watsup:951.1-956.29 - rule store {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, x : idx}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype (nt <: valtype)], [])) - -- if (C.MEM_context[x] = mt) - -- if ((2 ^ n_A) <= ($size(nt <: valtype) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt <: valtype) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn <: numtype))) + ;; 6-typing.watsup:544.1-545.34 + rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) ;; 6-typing.watsup:504.1-504.67 relation Instrf_ok: `%|-%:%`(context, instr, instrtype) - ;; 6-typing.watsup:518.1-520.41 - rule instr {C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + ;; 6-typing.watsup:861.1-863.28 + rule local.tee {C : context, init : init, t : valtype, x : idx}: + `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) + -- if (C.LOCAL_context[x] = `%%`(init, t)) ;; 6-typing.watsup:857.1-859.28 rule local.set {C : context, init : init, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) -- if (C.LOCAL_context[x] = `%%`(init, t)) - ;; 6-typing.watsup:861.1-863.28 - rule local.tee {C : context, init : init, t : valtype, x : idx}: - `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) - -- if (C.LOCAL_context[x] = `%%`(init, t)) + ;; 6-typing.watsup:518.1-520.41 + rule instr {C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) ;; 6-typing.watsup:505.1-505.74 relation Instrs_ok: `%|-%*:%`(context, instr*, instrtype) - ;; 6-typing.watsup:522.1-523.29 - rule empty {C : context}: - `%|-%*:%`(C, [], `%->%*%`([], [], [])) + ;; 6-typing.watsup:537.1-539.47 + rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%*:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + + ;; 6-typing.watsup:532.1-535.35 + rule sub {C : context, instr* : instr*, it : instrtype, it' : instrtype}: + `%|-%*:%`(C, instr*{instr}, it') + -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, it) + -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:525.1-530.52 rule seq {C : context, C' : context, init* : init*, instr_1 : instr, instr_2* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, x_1* : idx*, x_2* : idx*}: @@ -2730,16 +2893,9 @@ relation Instrs_ok: `%|-%*:%`(context, instr*, instrtype) -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) -- Instrs_ok: `%|-%*:%`(C', instr_2*{instr_2}, `%->%*%`(t_2*{t_2}, x_2*{x_2}, t_3*{t_3})) - ;; 6-typing.watsup:532.1-535.35 - rule sub {C : context, instr* : instr*, it : instrtype, it' : instrtype}: - `%|-%*:%`(C, instr*{instr}, it') - -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, it) - -- Instrtype_sub: `%|-%<:%`(C, it, it') - - ;; 6-typing.watsup:537.1-539.47 - rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%*:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:522.1-523.29 + rule empty {C : context}: + `%|-%*:%`(C, [], `%->%*%`([], [], [])) } ;; 6-typing.watsup:506.1-506.72 @@ -2754,10 +2910,10 @@ rec { ;; 6-typing.watsup:985.1-985.64 def in_binop : (binop_numtype, ibinop*) -> bool - ;; 6-typing.watsup:986.1-986.38 - def {binop : binop_numtype, epsilon : ibinop*} in_binop(binop, epsilon) = false ;; 6-typing.watsup:987.1-987.92 def {binop : binop_numtype, ibinop'* : ibinop*, ibinop_1 : ibinop} in_binop(binop, [ibinop_1] :: ibinop'*{ibinop'}) = ((binop = _I_binop_numtype(ibinop_1)) \/ $in_binop(binop, ibinop'*{ibinop'})) + ;; 6-typing.watsup:986.1-986.38 + def {binop : binop_numtype, epsilon : ibinop*} in_binop(binop, epsilon) = false } ;; 6-typing.watsup:981.1-981.63 @@ -2765,36 +2921,36 @@ rec { ;; 6-typing.watsup:981.1-981.63 def in_numtype : (numtype, numtype*) -> bool - ;; 6-typing.watsup:982.1-982.37 - def {epsilon : numtype*, nt : numtype} in_numtype(nt, epsilon) = false ;; 6-typing.watsup:983.1-983.68 def {nt : numtype, nt'* : numtype*, nt_1 : numtype} in_numtype(nt, [nt_1] :: nt'*{nt'}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt'})) + ;; 6-typing.watsup:982.1-982.37 + def {epsilon : numtype*, nt : numtype} in_numtype(nt, epsilon) = false } ;; 6-typing.watsup:963.1-963.78 relation Instr_const: `%|-%CONST`(context, instr) - ;; 6-typing.watsup:967.1-968.26 - rule const {C : context, c : c, nt : numtype}: - `%|-%CONST`(C, CONST_instr(nt, c)) + ;; 6-typing.watsup:989.1-992.38 + rule binop {C : context, binop : binop_numtype, nt : numtype}: + `%|-%CONST`(C, BINOP_instr(nt, binop)) + -- if $in_numtype(nt, [I32_numtype I64_numtype]) + -- if $in_binop(binop, [ADD_ibinop SUB_ibinop MUL_ibinop]) - ;; 6-typing.watsup:970.1-971.27 - rule ref.null {C : context, ht : heaptype}: - `%|-%CONST`(C, REF.NULL_instr(ht)) + ;; 6-typing.watsup:976.1-978.24 + rule global.get {C : context, t : valtype, x : idx}: + `%|-%CONST`(C, GLOBAL.GET_instr(x)) + -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?()), t)) ;; 6-typing.watsup:973.1-974.26 rule ref.func {C : context, x : idx}: `%|-%CONST`(C, REF.FUNC_instr(x)) - ;; 6-typing.watsup:976.1-978.24 - rule global.get {C : context, t : valtype, x : idx}: - `%|-%CONST`(C, GLOBAL.GET_instr(x)) - -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?()), t)) + ;; 6-typing.watsup:970.1-971.27 + rule ref.null {C : context, ht : heaptype}: + `%|-%CONST`(C, REF.NULL_instr(ht)) - ;; 6-typing.watsup:989.1-992.38 - rule binop {C : context, binop : binop_numtype, nt : numtype}: - `%|-%CONST`(C, BINOP_instr(nt, binop)) - -- if $in_numtype(nt, [I32_numtype I64_numtype]) - -- if $in_binop(binop, [ADD_ibinop SUB_ibinop MUL_ibinop]) + ;; 6-typing.watsup:967.1-968.26 + rule const {C : context, c : c, nt : numtype}: + `%|-%CONST`(C, CONST_instr(nt, c)) ;; 6-typing.watsup:964.1-964.77 relation Expr_const: `%|-%CONST`(context, expr) @@ -2822,16 +2978,16 @@ relation Type_ok: `%|-%:%*`(context, type, deftype*) ;; 6-typing.watsup:1013.1-1013.74 relation Local_ok: `%|-%:%`(context, local, localtype) - ;; 6-typing.watsup:1029.1-1031.28 - rule set {C : context, t : valtype}: - `%|-%:%`(C, LOCAL(t), `%%`(SET_init, t)) - -- if ($default(t) =/= ?()) - ;; 6-typing.watsup:1033.1-1035.26 rule unset {C : context, t : valtype}: `%|-%:%`(C, LOCAL(t), `%%`(UNSET_init, t)) -- if ($default(t) = ?()) + ;; 6-typing.watsup:1029.1-1031.28 + rule set {C : context, t : valtype}: + `%|-%:%`(C, LOCAL(t), `%%`(SET_init, t)) + -- if ($default(t) =/= ?()) + ;; 6-typing.watsup:1012.1-1012.73 relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup:1037.1-1041.82 @@ -2868,19 +3024,19 @@ relation Mem_ok: `%|-%:%`(context, mem, memtype) ;; 6-typing.watsup:1019.1-1019.77 relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) - ;; 6-typing.watsup:1068.1-1071.45 - rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} + ;; 6-typing.watsup:1076.1-1077.20 + rule declare {C : context, rt : reftype}: + `%|-%:%`(C, DECLARE_elemmode, rt) ;; 6-typing.watsup:1073.1-1074.20 rule passive {C : context, rt : reftype}: `%|-%:%`(C, PASSIVE_elemmode, rt) - ;; 6-typing.watsup:1076.1-1077.20 - rule declare {C : context, rt : reftype}: - `%|-%:%`(C, DECLARE_elemmode, rt) + ;; 6-typing.watsup:1068.1-1071.45 + rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup:1017.1-1017.73 relation Elem_ok: `%|-%:%`(context, elem, reftype) @@ -2892,16 +3048,16 @@ relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup:1020.1-1020.77 relation Datamode_ok: `%|-%:OK`(context, datamode) + ;; 6-typing.watsup:1084.1-1085.20 + rule passive {C : context}: + `%|-%:OK`(C, PASSIVE_datamode) + ;; 6-typing.watsup:1079.1-1082.45 rule active {C : context, expr : expr, mt : memtype, x : idx}: `%|-%:OK`(C, ACTIVE_datamode(x, expr)) -- if (C.MEM_context[x] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 6-typing.watsup:1084.1-1085.20 - rule passive {C : context}: - `%|-%:OK`(C, PASSIVE_datamode) - ;; 6-typing.watsup:1018.1-1018.73 relation Data_ok: `%|-%:OK`(context, data) ;; 6-typing.watsup:1064.1-1066.37 @@ -2925,25 +3081,25 @@ relation Import_ok: `%|-%:%`(context, import, externtype) ;; 6-typing.watsup:1096.1-1096.83 relation Externidx_ok: `%|-%:%`(context, externidx, externtype) - ;; 6-typing.watsup:1107.1-1109.23 - rule func {C : context, dt : deftype, x : idx}: - `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) - -- if (C.FUNC_context[x] = dt) - - ;; 6-typing.watsup:1111.1-1113.25 - rule global {C : context, gt : globaltype, x : idx}: - `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) - -- if (C.GLOBAL_context[x] = gt) + ;; 6-typing.watsup:1119.1-1121.22 + rule mem {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) + -- if (C.MEM_context[x] = mt) ;; 6-typing.watsup:1115.1-1117.24 rule table {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE_externidx(x), TABLE_externtype(tt)) -- if (C.TABLE_context[x] = tt) - ;; 6-typing.watsup:1119.1-1121.22 - rule mem {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:1111.1-1113.25 + rule global {C : context, gt : globaltype, x : idx}: + `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) + -- if (C.GLOBAL_context[x] = gt) + + ;; 6-typing.watsup:1107.1-1109.23 + rule func {C : context, dt : deftype, x : idx}: + `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) + -- if (C.FUNC_context[x] = dt) ;; 6-typing.watsup:1095.1-1095.80 relation Export_ok: `%|-%:%`(context, export, externtype) @@ -2957,15 +3113,15 @@ rec { ;; 6-typing.watsup:1128.1-1128.77 relation Globals_ok: `%|-%*:%*`(context, global*, globaltype*) - ;; 6-typing.watsup:1171.1-1172.17 - rule empty {C : context}: - `%|-%*:%*`(C, [], []) - ;; 6-typing.watsup:1174.1-1177.54 rule cons {C : context, global : global, global_1 : global, gt* : globaltype*, gt_1 : globaltype}: `%|-%*:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt}) -- Global_ok: `%|-%:%`(C, global, gt_1) -- Globals_ok: `%|-%*:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt}) + + ;; 6-typing.watsup:1171.1-1172.17 + rule empty {C : context}: + `%|-%*:%*`(C, [], []) } ;; 6-typing.watsup:1127.1-1127.75 @@ -2973,15 +3129,15 @@ rec { ;; 6-typing.watsup:1127.1-1127.75 relation Types_ok: `%|-%*:%*`(context, type*, deftype*) - ;; 6-typing.watsup:1163.1-1164.17 - rule empty {C : context}: - `%|-%*:%*`(C, [], []) - ;; 6-typing.watsup:1166.1-1169.49 rule cons {C : context, dt* : deftype*, dt_1 : deftype, type* : type*, type_1 : type}: `%|-%*:%*`(C, [type_1] :: type*{type}, dt_1*{} :: dt*{dt}) -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) -- Types_ok: `%|-%*:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, dt*{dt}) + + ;; 6-typing.watsup:1163.1-1164.17 + rule empty {C : context}: + `%|-%*:%*`(C, [], []) } ;; 6-typing.watsup:1126.1-1126.76 @@ -3008,474 +3164,485 @@ relation Module_ok: `|-%:OK`(module) ;; 7-runtime-typing.watsup:5.1-5.40 relation Ref_ok: `%|-%:%`(store, ref, reftype) - ;; 7-runtime-typing.watsup:7.1-8.35 - rule null {ht : heaptype, s : store}: - `%|-%:%`(s, REF.NULL_ref(ht), REF_reftype(`NULL%?`(?(())), ht)) + ;; 7-runtime-typing.watsup:28.1-29.45 + rule extern {addrref : addrref, s : store}: + `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) - ;; 7-runtime-typing.watsup:10.1-11.37 - rule i31 {i : nat, s : store}: - `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) + ;; 7-runtime-typing.watsup:25.1-26.39 + rule host {a : addr, s : store}: + `%|-%:%`(s, REF.HOST_ADDR_ref(a), REF_reftype(`NULL%?`(?()), ANY_heaptype)) - ;; 7-runtime-typing.watsup:13.1-15.30 - rule struct {a : addr, dt : deftype, s : store}: - `%|-%:%`(s, REF.STRUCT_ADDR_ref(a), REF_reftype(`NULL%?`(?()), (dt <: heaptype))) - -- if (s.STRUCT_store[a].TYPE_structinst = dt) + ;; 7-runtime-typing.watsup:21.1-23.28 + rule func {a : addr, dt : deftype, s : store}: + `%|-%:%`(s, REF.FUNC_ADDR_ref(a), REF_reftype(`NULL%?`(?()), (dt <: heaptype))) + -- if (s.FUNC_store[a].TYPE_funcinst = dt) ;; 7-runtime-typing.watsup:17.1-19.29 rule array {a : addr, dt : deftype, s : store}: `%|-%:%`(s, REF.ARRAY_ADDR_ref(a), REF_reftype(`NULL%?`(?()), (dt <: heaptype))) -- if (s.ARRAY_store[a].TYPE_arrayinst = dt) - ;; 7-runtime-typing.watsup:21.1-23.28 - rule func {a : addr, dt : deftype, s : store}: - `%|-%:%`(s, REF.FUNC_ADDR_ref(a), REF_reftype(`NULL%?`(?()), (dt <: heaptype))) - -- if (s.FUNC_store[a].TYPE_funcinst = dt) + ;; 7-runtime-typing.watsup:13.1-15.30 + rule struct {a : addr, dt : deftype, s : store}: + `%|-%:%`(s, REF.STRUCT_ADDR_ref(a), REF_reftype(`NULL%?`(?()), (dt <: heaptype))) + -- if (s.STRUCT_store[a].TYPE_structinst = dt) - ;; 7-runtime-typing.watsup:25.1-26.39 - rule host {a : addr, s : store}: - `%|-%:%`(s, REF.HOST_ADDR_ref(a), REF_reftype(`NULL%?`(?()), ANY_heaptype)) + ;; 7-runtime-typing.watsup:10.1-11.37 + rule i31 {i : nat, s : store}: + `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) - ;; 7-runtime-typing.watsup:28.1-29.45 - rule extern {addrref : addrref, s : store}: - `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) + ;; 7-runtime-typing.watsup:7.1-8.35 + rule null {ht : heaptype, s : store}: + `%|-%:%`(s, REF.NULL_ref(ht), REF_reftype(`NULL%?`(?(())), ht)) ;; 8-reduction.watsup:6.1-6.63 relation Step_pure: `%*~>%*`(admininstr*, admininstr*) - ;; 8-reduction.watsup:42.1-43.24 - rule unreachable: - `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) - - ;; 8-reduction.watsup:45.1-46.15 - rule nop: - `%*~>%*`([NOP_admininstr], []) - - ;; 8-reduction.watsup:48.1-49.20 - rule drop {val : val}: - `%*~>%*`([(val <: admininstr) DROP_admininstr], []) - - ;; 8-reduction.watsup:52.1-54.16 - rule select-true {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: - `%*~>%*`([(val_1 <: admininstr) (val_2 <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_1 <: admininstr)]) - -- if (c =/= 0) + ;; 8-reduction.watsup:552.1-553.47 + rule local.tee {val : val, x : idx}: + `%*~>%*`([(val <: admininstr) LOCAL.TEE_admininstr(x)], [(val <: admininstr) (val <: admininstr) LOCAL.SET_admininstr(x)]) - ;; 8-reduction.watsup:56.1-58.14 - rule select-false {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: - `%*~>%*`([(val_1 <: admininstr) (val_2 <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_2 <: admininstr)]) - -- if (c = 0) + ;; 8-reduction.watsup:539.1-540.55 + rule any.convert_extern-addr {addrref : addrref}: + `%*~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref <: admininstr)]) - ;; 8-reduction.watsup:76.1-78.16 - rule if-true {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) - -- if (c =/= 0) + ;; 8-reduction.watsup:536.1-537.55 + rule any.convert_extern-null {ht : heaptype}: + `%*~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) - ;; 8-reduction.watsup:80.1-82.14 - rule if-false {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) - -- if (c = 0) + ;; 8-reduction.watsup:532.1-533.55 + rule extern.convert_any-addr {addrref : addrref}: + `%*~>%*`([(addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) - ;; 8-reduction.watsup:85.1-86.38 - rule label-vals {instr* : instr*, n : n, val* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr*{instr}, (val <: admininstr)*{val})], (val <: admininstr)*{val}) + ;; 8-reduction.watsup:529.1-530.58 + rule extern.convert_any-null {ht : heaptype}: + `%*~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) - ;; 8-reduction.watsup:92.1-93.69 - rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val' <: admininstr)*{val'} :: (val <: admininstr)^n{val} :: [BR_admininstr(0)] :: (instr <: admininstr)*{instr})], (val <: admininstr)^n{val} :: (instr' <: admininstr)*{instr'}) + ;; 8-reduction.watsup:311.1-312.68 + rule i31.get-num {i : nat, sx : sx}: + `%*~>%*`([REF.I31_NUM_admininstr(i) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, i))]) - ;; 8-reduction.watsup:95.1-96.65 - rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val <: admininstr)*{val} :: [BR_admininstr(l + 1)] :: (instr <: admininstr)*{instr})], (val <: admininstr)*{val} :: [BR_admininstr(l)]) + ;; 8-reduction.watsup:308.1-309.39 + rule i31.get-null {ht : heaptype, sx : sx}: + `%*~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) - ;; 8-reduction.watsup:99.1-101.16 - rule br_if-true {c : c, l : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) - -- if (c =/= 0) + ;; 8-reduction.watsup:281.1-283.15 + rule ref.eq-false {ref_1 : ref, ref_2 : ref}: + `%*~>%*`([(ref_1 <: admininstr) (ref_2 <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 0)]) + -- otherwise - ;; 8-reduction.watsup:103.1-105.14 - rule br_if-false {c : c, l : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) - -- if (c = 0) + ;; 8-reduction.watsup:276.1-279.22 + rule ref.eq-true {ref_1 : ref, ref_2 : ref}: + `%*~>%*`([(ref_1 <: admininstr) (ref_2 <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- otherwise + -- if (ref_1 = ref_2) - ;; 8-reduction.watsup:108.1-110.17 - rule br_table-lt {i : nat, l* : labelidx*, l' : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) - -- if (i < |l*{l}|) + ;; 8-reduction.watsup:272.1-274.55 + rule ref.eq-null {ht_1 : heaptype, ht_2 : heaptype, ref_1 : ref, ref_2 : ref}: + `%*~>%*`([(ref_1 <: admininstr) (ref_2 <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) - ;; 8-reduction.watsup:112.1-114.18 - rule br_table-ge {i : nat, l* : labelidx*, l' : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) - -- if (i >= |l*{l}|) + ;; 8-reduction.watsup:267.1-269.15 + rule ref.as_non_null-addr {ref : ref}: + `%*~>%*`([(ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref <: admininstr)]) + -- otherwise - ;; 8-reduction.watsup:117.1-119.26 - rule br_on_null-null {ht : heaptype, l : labelidx, val : val}: - `%*~>%*`([(val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) - -- if (val = REF.NULL_val(ht)) + ;; 8-reduction.watsup:263.1-265.28 + rule ref.as_non_null-null {ht : heaptype, ref : ref}: + `%*~>%*`([(ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) + -- if (ref = REF.NULL_ref(ht)) - ;; 8-reduction.watsup:121.1-123.15 - rule br_on_null-addr {l : labelidx, val : val}: - `%*~>%*`([(val <: admininstr) BR_ON_NULL_admininstr(l)], [(val <: admininstr)]) + ;; 8-reduction.watsup:258.1-260.15 + rule ref.is_null-false {val : val}: + `%*~>%*`([(val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 8-reduction.watsup:126.1-128.26 - rule br_on_non_null-null {ht : heaptype, l : labelidx, val : val}: - `%*~>%*`([(val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) + ;; 8-reduction.watsup:254.1-256.28 + rule ref.is_null-true {ht : heaptype, val : val}: + `%*~>%*`([(val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:130.1-132.15 - rule br_on_non_null-addr {l : labelidx, val : val}: - `%*~>%*`([(val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val <: admininstr) BR_admininstr(l)]) - -- otherwise - - ;; 8-reduction.watsup:186.1-187.84 - rule call_indirect-call {x : idx, y : idx}: - `%*~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) <: heaptype))) CALL_REF_admininstr(?(y))]) + ;; 8-reduction.watsup:250.1-251.60 + rule ref.i31 {i : nat}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, i))]) - ;; 8-reduction.watsup:189.1-190.98 - rule return_call_indirect {x : idx, y : idx}: - `%*~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) + ;; 8-reduction.watsup:240.1-242.50 + rule cvtop-trap {c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: + `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) + -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = []) - ;; 8-reduction.watsup:193.1-194.35 - rule frame-vals {f : frame, n : n, val^n : val^n}: - `%*~>%*`([FRAME__admininstr(n, f, (val <: admininstr)^n{val})], (val <: admininstr)^n{val}) + ;; 8-reduction.watsup:236.1-238.48 + rule cvtop-val {c : c, c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: + `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) + -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = [c]) - ;; 8-reduction.watsup:196.1-197.55 - rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: - `%*~>%*`([FRAME__admininstr(n, f, (val' <: admininstr)*{val'} :: (val <: admininstr)^n{val} :: [RETURN_admininstr] :: (instr <: admininstr)*{instr})], (val <: admininstr)^n{val}) + ;; 8-reduction.watsup:232.1-233.70 + rule extend {c : c, n : n, nt : numtype}: + `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, $size(nt <: valtype), S_sx, c))]) - ;; 8-reduction.watsup:199.1-200.60 - rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: - `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, (val <: admininstr)*{val} :: [RETURN_admininstr] :: (instr <: admininstr)*{instr})], (val <: admininstr)*{val} :: [RETURN_admininstr]) + ;; 8-reduction.watsup:227.1-229.40 + rule relop {c : c, c_1 : c, c_2 : c, nt : numtype, relop : relop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) + -- if (c = $relop(relop, nt, c_1, c_2)) - ;; 8-reduction.watsup:205.1-207.33 - rule unop-val {c : c, c_1 : c, nt : numtype, unop : unop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) - -- if ($unop(unop, nt, c_1) = [c]) + ;; 8-reduction.watsup:223.1-225.37 + rule testop {c : c, c_1 : c, nt : numtype, testop : testop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) + -- if (c = $testop(testop, nt, c_1)) - ;; 8-reduction.watsup:209.1-211.35 - rule unop-trap {c_1 : c, nt : numtype, unop : unop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) - -- if ($unop(unop, nt, c_1) = []) + ;; 8-reduction.watsup:218.1-220.42 + rule binop-trap {binop : binop_numtype, c_1 : c, c_2 : c, nt : numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) + -- if ($binop(binop, nt, c_1, c_2) = []) ;; 8-reduction.watsup:214.1-216.40 rule binop-val {binop : binop_numtype, c : c, c_1 : c, c_2 : c, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(binop, nt, c_1, c_2) = [c]) - ;; 8-reduction.watsup:218.1-220.42 - rule binop-trap {binop : binop_numtype, c_1 : c, c_2 : c, nt : numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) - -- if ($binop(binop, nt, c_1, c_2) = []) + ;; 8-reduction.watsup:209.1-211.35 + rule unop-trap {c_1 : c, nt : numtype, unop : unop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) + -- if ($unop(unop, nt, c_1) = []) - ;; 8-reduction.watsup:223.1-225.37 - rule testop {c : c, c_1 : c, nt : numtype, testop : testop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) - -- if (c = $testop(testop, nt, c_1)) + ;; 8-reduction.watsup:205.1-207.33 + rule unop-val {c : c, c_1 : c, nt : numtype, unop : unop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) + -- if ($unop(unop, nt, c_1) = [c]) - ;; 8-reduction.watsup:227.1-229.40 - rule relop {c : c, c_1 : c, c_2 : c, nt : numtype, relop : relop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) - -- if (c = $relop(relop, nt, c_1, c_2)) + ;; 8-reduction.watsup:199.1-200.60 + rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: + `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, (val <: admininstr)*{val} :: [RETURN_admininstr] :: (instr <: admininstr)*{instr})], (val <: admininstr)*{val} :: [RETURN_admininstr]) - ;; 8-reduction.watsup:232.1-233.70 - rule extend {c : c, n : n, nt : numtype}: - `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, $size(nt <: valtype), S_sx, c))]) + ;; 8-reduction.watsup:196.1-197.55 + rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: + `%*~>%*`([FRAME__admininstr(n, f, (val' <: admininstr)*{val'} :: (val <: admininstr)^n{val} :: [RETURN_admininstr] :: (instr <: admininstr)*{instr})], (val <: admininstr)^n{val}) - ;; 8-reduction.watsup:236.1-238.48 - rule cvtop-val {c : c, c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: - `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) - -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = [c]) + ;; 8-reduction.watsup:193.1-194.35 + rule frame-vals {f : frame, n : n, val^n : val^n}: + `%*~>%*`([FRAME__admininstr(n, f, (val <: admininstr)^n{val})], (val <: admininstr)^n{val}) - ;; 8-reduction.watsup:240.1-242.50 - rule cvtop-trap {c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: - `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) - -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = []) + ;; 8-reduction.watsup:189.1-190.98 + rule return_call_indirect {x : idx, y : idx}: + `%*~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) - ;; 8-reduction.watsup:250.1-251.60 - rule ref.i31 {i : nat}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, i))]) + ;; 8-reduction.watsup:186.1-187.84 + rule call_indirect-call {x : idx, y : idx}: + `%*~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) <: heaptype))) CALL_REF_admininstr(?(y))]) - ;; 8-reduction.watsup:254.1-256.28 - rule ref.is_null-true {ht : heaptype, val : val}: - `%*~>%*`([(val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) + ;; 8-reduction.watsup:130.1-132.15 + rule br_on_non_null-addr {l : labelidx, val : val}: + `%*~>%*`([(val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val <: admininstr) BR_admininstr(l)]) + -- otherwise + + ;; 8-reduction.watsup:126.1-128.26 + rule br_on_non_null-null {ht : heaptype, l : labelidx, val : val}: + `%*~>%*`([(val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:258.1-260.15 - rule ref.is_null-false {val : val}: - `%*~>%*`([(val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) + ;; 8-reduction.watsup:121.1-123.15 + rule br_on_null-addr {l : labelidx, val : val}: + `%*~>%*`([(val <: admininstr) BR_ON_NULL_admininstr(l)], [(val <: admininstr)]) -- otherwise - ;; 8-reduction.watsup:263.1-265.28 - rule ref.as_non_null-null {ht : heaptype, ref : ref}: - `%*~>%*`([(ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) - -- if (ref = REF.NULL_ref(ht)) + ;; 8-reduction.watsup:117.1-119.26 + rule br_on_null-null {ht : heaptype, l : labelidx, val : val}: + `%*~>%*`([(val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) + -- if (val = REF.NULL_val(ht)) + + ;; 8-reduction.watsup:112.1-114.18 + rule br_table-ge {i : nat, l* : labelidx*, l' : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) + -- if (i >= |l*{l}|) + + ;; 8-reduction.watsup:108.1-110.17 + rule br_table-lt {i : nat, l* : labelidx*, l' : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) + -- if (i < |l*{l}|) + + ;; 8-reduction.watsup:103.1-105.14 + rule br_if-false {c : c, l : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) + -- if (c = 0) - ;; 8-reduction.watsup:267.1-269.15 - rule ref.as_non_null-addr {ref : ref}: - `%*~>%*`([(ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref <: admininstr)]) - -- otherwise + ;; 8-reduction.watsup:99.1-101.16 + rule br_if-true {c : c, l : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) + -- if (c =/= 0) - ;; 8-reduction.watsup:272.1-274.55 - rule ref.eq-null {ht_1 : heaptype, ht_2 : heaptype, ref_1 : ref, ref_2 : ref}: - `%*~>%*`([(ref_1 <: admininstr) (ref_2 <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) + ;; 8-reduction.watsup:95.1-96.65 + rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val <: admininstr)*{val} :: [BR_admininstr(l + 1)] :: (instr <: admininstr)*{instr})], (val <: admininstr)*{val} :: [BR_admininstr(l)]) - ;; 8-reduction.watsup:276.1-279.22 - rule ref.eq-true {ref_1 : ref, ref_2 : ref}: - `%*~>%*`([(ref_1 <: admininstr) (ref_2 <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- otherwise - -- if (ref_1 = ref_2) + ;; 8-reduction.watsup:92.1-93.69 + rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val' <: admininstr)*{val'} :: (val <: admininstr)^n{val} :: [BR_admininstr(0)] :: (instr <: admininstr)*{instr})], (val <: admininstr)^n{val} :: (instr' <: admininstr)*{instr'}) - ;; 8-reduction.watsup:281.1-283.15 - rule ref.eq-false {ref_1 : ref, ref_2 : ref}: - `%*~>%*`([(ref_1 <: admininstr) (ref_2 <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 0)]) - -- otherwise + ;; 8-reduction.watsup:85.1-86.38 + rule label-vals {instr* : instr*, n : n, val* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr*{instr}, (val <: admininstr)*{val})], (val <: admininstr)*{val}) - ;; 8-reduction.watsup:308.1-309.39 - rule i31.get-null {ht : heaptype, sx : sx}: - `%*~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) + ;; 8-reduction.watsup:80.1-82.14 + rule if-false {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) + -- if (c = 0) - ;; 8-reduction.watsup:311.1-312.68 - rule i31.get-num {i : nat, sx : sx}: - `%*~>%*`([REF.I31_NUM_admininstr(i) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, i))]) + ;; 8-reduction.watsup:76.1-78.16 + rule if-true {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) + -- if (c =/= 0) - ;; 8-reduction.watsup:529.1-530.58 - rule extern.convert_any-null {ht : heaptype}: - `%*~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) + ;; 8-reduction.watsup:56.1-58.14 + rule select-false {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: + `%*~>%*`([(val_1 <: admininstr) (val_2 <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_2 <: admininstr)]) + -- if (c = 0) - ;; 8-reduction.watsup:532.1-533.55 - rule extern.convert_any-addr {addrref : addrref}: - `%*~>%*`([(addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) + ;; 8-reduction.watsup:52.1-54.16 + rule select-true {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: + `%*~>%*`([(val_1 <: admininstr) (val_2 <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_1 <: admininstr)]) + -- if (c =/= 0) - ;; 8-reduction.watsup:536.1-537.55 - rule any.convert_extern-null {ht : heaptype}: - `%*~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) + ;; 8-reduction.watsup:48.1-49.20 + rule drop {val : val}: + `%*~>%*`([(val <: admininstr) DROP_admininstr], []) - ;; 8-reduction.watsup:539.1-540.55 - rule any.convert_extern-addr {addrref : addrref}: - `%*~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref <: admininstr)]) + ;; 8-reduction.watsup:45.1-46.15 + rule nop: + `%*~>%*`([NOP_admininstr], []) - ;; 8-reduction.watsup:552.1-553.47 - rule local.tee {val : val, x : idx}: - `%*~>%*`([(val <: admininstr) LOCAL.TEE_admininstr(x)], [(val <: admininstr) (val <: admininstr) LOCAL.SET_admininstr(x)]) + ;; 8-reduction.watsup:42.1-43.24 + rule unreachable: + `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) ;; 8-reduction.watsup:63.1-63.73 def blocktype : (state, blocktype) -> functype - ;; 8-reduction.watsup:64.1-64.44 - def {z : state} blocktype(z, _RESULT_blocktype(?())) = `%->%`([], []) - ;; 8-reduction.watsup:65.1-65.40 - def {t : valtype, z : state} blocktype(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) ;; 8-reduction.watsup:66.1-66.66 def {ft : functype, x : idx, z : state} blocktype(z, _IDX_blocktype(x)) = ft -- Expand: `%~~%`($type(z, x), FUNC_comptype(ft)) + ;; 8-reduction.watsup:65.1-65.40 + def {t : valtype, z : state} blocktype(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) + ;; 8-reduction.watsup:64.1-64.44 + def {z : state} blocktype(z, _RESULT_blocktype(?())) = `%->%`([], []) ;; 8-reduction.watsup:7.1-7.63 relation Step_read: `%~>%*`(config, admininstr*) - ;; 8-reduction.watsup:68.1-70.43 - rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: - `%~>%*`(`%;%*`(z, (val <: admininstr)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], (val <: admininstr)^k{val} :: (instr <: admininstr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + ;; 8-reduction.watsup:753.1-757.15 + rule memory.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, y).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x, y)]) + -- otherwise - ;; 8-reduction.watsup:72.1-74.43 - rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: - `%~>%*`(`%;%*`(z, (val <: admininstr)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], (val <: admininstr)^k{val} :: (instr <: admininstr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + ;; 8-reduction.watsup:748.1-751.14 + rule memory.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:135.1-138.66 - rule br_on_cast-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref <: admininstr) BR_admininstr(l)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt) - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) + ;; 8-reduction.watsup:744.1-746.70 + rule memory.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) - ;; 8-reduction.watsup:140.1-142.15 - rule br_on_cast-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref <: admininstr)]) + ;; 8-reduction.watsup:737.1-741.15 + rule memory.copy-gt {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise - ;; 8-reduction.watsup:145.1-148.66 - rule br_on_cast_fail-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref <: admininstr)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt) - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) + ;; 8-reduction.watsup:730.1-735.19 + rule memory.copy-le {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, (i_1 + 1)) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) + -- otherwise + -- if (i_1 <= i_2) - ;; 8-reduction.watsup:150.1-152.15 - rule br_on_cast_fail-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref <: admininstr) BR_admininstr(l)]) + ;; 8-reduction.watsup:725.1-728.14 + rule memory.copy-zero {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), []) -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:157.1-158.62 - rule call {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) CALL_REF_admininstr(?())]) + ;; 8-reduction.watsup:721.1-723.77 + rule memory.copy-oob {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) - ;; 8-reduction.watsup:160.1-161.43 - rule call_ref-null {ht : heaptype, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) + ;; 8-reduction.watsup:714.1-718.15 + rule memory.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) (val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (i + 1)) (val <: admininstr) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr(x)]) + -- otherwise - ;; 8-reduction.watsup:163.1-168.59 - rule call_ref-func {a : addr, f : frame, fi : funcinst, instr* : instr*, m : m, n : n, t* : valtype*, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, x? : idx?, y : idx, z : state}: - `%~>%*`(`%;%*`(z, (val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr <: admininstr)*{instr})])]) - -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) - -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) + ;; 8-reduction.watsup:709.1-712.14 + rule memory.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:171.1-172.76 - rule return_call {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) RETURN_CALL_REF_admininstr(?())]) + ;; 8-reduction.watsup:705.1-707.37 + rule memory.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:175.1-176.78 - rule return_call_ref-frame-null {f : frame, ht : heaptype, instr* : instr*, k : nat, val* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val <: admininstr)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr <: admininstr)*{instr})]), [TRAP_admininstr]) + ;; 8-reduction.watsup:692.1-694.44 + rule memory.size {n : n, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) + -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:178.1-180.59 - rule return_call_ref-frame-addr {a : addr, f : frame, instr* : instr*, k : nat, m : m, n : n, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, val'* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' <: admininstr)*{val'} :: (val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr <: admininstr)*{instr})]), (val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + ;; 8-reduction.watsup:670.1-672.61 + rule load-pack-val {c : c, i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [CONST_admininstr(nt, $ext(n, $size(nt <: valtype), sx, c))]) + -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) - ;; 8-reduction.watsup:182.1-183.91 - rule return_call_ref-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, (val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr <: admininstr)*{instr})]), (val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) + ;; 8-reduction.watsup:666.1-668.51 + rule load-pack-oob {i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [TRAP_admininstr]) + -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:247.1-248.55 - rule ref.func {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) + ;; 8-reduction.watsup:662.1-664.71 + rule load-num-val {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) + -- if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : ($size(nt <: valtype) / 8)]) - ;; 8-reduction.watsup:286.1-289.65 - rule ref.test-true {ref : ref, rt : reftype, rt' : reftype, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 1)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt') - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) + ;; 8-reduction.watsup:658.1-660.59 + rule load-num-oob {i : nat, mo : memop, nt : numtype, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) + -- if (((i + mo.OFFSET_memop) + ($size(nt <: valtype) / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:291.1-293.15 - rule ref.test-false {ref : ref, rt : reftype, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 0)]) + ;; 8-reduction.watsup:645.1-649.15 + rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) ($elem(z, y).ELEM_eleminst[i] <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.INIT_admininstr(x, y)]) -- otherwise - ;; 8-reduction.watsup:296.1-299.65 - rule ref.cast-succeed {ref : ref, rt : reftype, rt' : reftype, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref <: admininstr)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt') - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) - - ;; 8-reduction.watsup:301.1-303.15 - rule ref.cast-fail {ref : ref, rt : reftype, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:640.1-643.14 + rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), []) -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:322.1-325.43 - rule struct.new_default {mut* : mut*, val* : val*, x : idx, z : state, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val <: admininstr)*{val} :: [STRUCT.NEW_admininstr(x)]) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} + ;; 8-reduction.watsup:636.1-638.72 + rule table.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) - ;; 8-reduction.watsup:328.1-329.50 - rule struct.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:629.1-633.15 + rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) + -- otherwise + + ;; 8-reduction.watsup:622.1-627.15 + rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) + -- otherwise + -- if (j <= i) - ;; 8-reduction.watsup:331.1-334.41 - rule struct.get-struct {a : addr, i : nat, mut* : mut*, si : structinst, sx? : sx?, x : idx, z : state, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]) <: admininstr)]) - -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + ;; 8-reduction.watsup:617.1-620.14 + rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:348.1-349.70 - rule array.new {n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [(val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.NEW_admininstr(x)]), (val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + ;; 8-reduction.watsup:613.1-615.73 + rule table.copy-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) - ;; 8-reduction.watsup:351.1-354.40 - rule array.new_default {mut : mut, n : n, val : val, x : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) ARRAY.NEW_DEFAULT_admininstr(x)]), (val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ($default($unpacktype(zt)) = ?(val)) + ;; 8-reduction.watsup:606.1-610.15 + rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) (val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) (val <: admininstr) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) + -- otherwise - ;; 8-reduction.watsup:362.1-364.38 - rule array.new_elem-oob {i : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) + ;; 8-reduction.watsup:601.1-604.14 + rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:366.1-368.40 - rule array.new_elem-alloc {i : nat, n : n, ref^n : ref^n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref <: admininstr)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) + ;; 8-reduction.watsup:597.1-599.39 + rule table.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:371.1-374.59 - rule array.new_data-oob {i : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) + ;; 8-reduction.watsup:584.1-586.32 + rule table.size {n : n, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) + -- if (|$table(z, x).ELEM_tableinst| = n) - ;; 8-reduction.watsup:376.1-380.88 - rule array.new_data-alloc {c^n : c^n, i : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (nt = $unpacknumtype(zt)) - -- if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) + ;; 8-reduction.watsup:571.1-573.32 + rule table.get-val {i : nat, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] <: admininstr)]) + -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:383.1-384.61 - rule array.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:567.1-569.33 + rule table.get-oob {i : nat, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) + -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:386.1-388.38 - rule array.get-oob {a : addr, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) - -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:558.1-559.45 + rule global.get {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst <: admininstr)]) - ;; 8-reduction.watsup:390.1-393.53 - rule array.get-array {a : addr, fv : fieldval, i : nat, mut : mut, sx? : sx?, x : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [($unpackval(zt, sx?{sx}, fv) <: admininstr)]) - -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) - -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) + ;; 8-reduction.watsup:545.1-547.27 + rule local.get {val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [(val <: admininstr)]) + -- if ($local(z, x) = ?(val)) - ;; 8-reduction.watsup:409.1-410.39 - rule array.len-null {ht : heaptype, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) + ;; 8-reduction.watsup:517.1-524.67 + rule array.init_data-succ {a : addr, c : c, i : nat, j : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + ($storagesize(zt) / 8))) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_DATA_admininstr(x, y)]) + -- otherwise + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (nt = $unpacknumtype(zt)) + -- if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) - ;; 8-reduction.watsup:412.1-414.37 - rule array.len-array {a : addr, n : n, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, n)]) - -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:512.1-515.14 + rule array.init_data-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:417.1-418.76 - rule array.fill-null {ht : heaptype, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:507.1-510.59 + rule array.init_data-oob2 {a : addr, i : nat, j : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) - ;; 8-reduction.watsup:420.1-422.44 - rule array.fill-oob {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:503.1-505.44 + rule array.init_data-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:424.1-427.14 - rule array.fill-zero {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:500.1-501.93 + rule array.init_data-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:429.1-433.15 - rule array.fill-succ {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) (val <: admininstr) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.FILL_admininstr(x)]) + ;; 8-reduction.watsup:492.1-497.34 + rule array.init_elem-succ {a : addr, i : nat, j : nat, n : n, ref : ref, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_ELEM_admininstr(x, y)]) -- otherwise + -- if (ref = $elem(z, y).ELEM_eleminst[j]) - ;; 8-reduction.watsup:435.1-436.102 - rule array.copy-null1 {ht_1 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, i_1) (ref <: admininstr) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:487.1-490.14 + rule array.init_elem-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:438.1-439.102 - rule array.copy-null2 {ht_2 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) CONST_admininstr(I32_numtype, i_1) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:483.1-485.38 + rule array.init_elem-oob2 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) - ;; 8-reduction.watsup:441.1-443.48 - rule array.copy-oob1 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) + ;; 8-reduction.watsup:479.1-481.44 + rule array.init_elem-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:445.1-447.48 - rule array.copy-oob2 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) + ;; 8-reduction.watsup:476.1-477.93 + rule array.init_elem-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:449.1-452.14 - rule array.copy-zero {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), []) + ;; 8-reduction.watsup:465.1-473.29 + rule array.copy-gt {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise - -- if (n = 0) + -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) + -- if (sx?{sx} = $sxfield(zt_2)) ;; 8-reduction.watsup:454.1-463.19 rule array.copy-le {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: @@ -3485,352 +3652,341 @@ relation Step_read: `%~>%*`(config, admininstr*) -- if (sx?{sx} = $sxfield(zt_2)) -- if (i_1 <= i_2) - ;; 8-reduction.watsup:465.1-473.29 - rule array.copy-gt {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) + ;; 8-reduction.watsup:449.1-452.14 + rule array.copy-zero {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), []) -- otherwise - -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (n = 0) - ;; 8-reduction.watsup:476.1-477.93 - rule array.init_elem-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:445.1-447.48 + rule array.copy-oob2 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) - ;; 8-reduction.watsup:479.1-481.44 - rule array.init_elem-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:441.1-443.48 + rule array.copy-oob1 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) - ;; 8-reduction.watsup:483.1-485.38 - rule array.init_elem-oob2 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) + ;; 8-reduction.watsup:438.1-439.102 + rule array.copy-null2 {ht_2 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) CONST_admininstr(I32_numtype, i_1) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:487.1-490.14 - rule array.init_elem-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:435.1-436.102 + rule array.copy-null1 {ht_1 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, i_1) (ref <: admininstr) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:492.1-497.34 - rule array.init_elem-succ {a : addr, i : nat, j : nat, n : n, ref : ref, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_ELEM_admininstr(x, y)]) + ;; 8-reduction.watsup:429.1-433.15 + rule array.fill-succ {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) (val <: admininstr) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.FILL_admininstr(x)]) -- otherwise - -- if (ref = $elem(z, y).ELEM_eleminst[j]) - ;; 8-reduction.watsup:500.1-501.93 - rule array.init_data-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:424.1-427.14 + rule array.fill-zero {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:503.1-505.44 - rule array.init_data-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:420.1-422.44 + rule array.fill-oob {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:507.1-510.59 - rule array.init_data-oob2 {a : addr, i : nat, j : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) - - ;; 8-reduction.watsup:512.1-515.14 - rule array.init_data-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:417.1-418.76 + rule array.fill-null {ht : heaptype, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:517.1-524.67 - rule array.init_data-succ {a : addr, c : c, i : nat, j : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + ($storagesize(zt) / 8))) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_DATA_admininstr(x, y)]) - -- otherwise - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (nt = $unpacknumtype(zt)) - -- if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) + ;; 8-reduction.watsup:412.1-414.37 + rule array.len-array {a : addr, n : n, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, n)]) + -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:545.1-547.27 - rule local.get {val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [(val <: admininstr)]) - -- if ($local(z, x) = ?(val)) + ;; 8-reduction.watsup:409.1-410.39 + rule array.len-null {ht : heaptype, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) - ;; 8-reduction.watsup:558.1-559.45 - rule global.get {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst <: admininstr)]) + ;; 8-reduction.watsup:390.1-393.53 + rule array.get-array {a : addr, fv : fieldval, i : nat, mut : mut, sx? : sx?, x : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [($unpackval(zt, sx?{sx}, fv) <: admininstr)]) + -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) + -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) - ;; 8-reduction.watsup:567.1-569.33 - rule table.get-oob {i : nat, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) - -- if (i >= |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:386.1-388.38 + rule array.get-oob {a : addr, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:571.1-573.32 - rule table.get-val {i : nat, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] <: admininstr)]) - -- if (i < |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:383.1-384.61 + rule array.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:584.1-586.32 - rule table.size {n : n, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) - -- if (|$table(z, x).ELEM_tableinst| = n) + ;; 8-reduction.watsup:376.1-380.88 + rule array.new_data-alloc {c^n : c^n, i : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (nt = $unpacknumtype(zt)) + -- if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) - ;; 8-reduction.watsup:597.1-599.39 - rule table.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:371.1-374.59 + rule array.new_data-oob {i : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) - ;; 8-reduction.watsup:601.1-604.14 - rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:366.1-368.40 + rule array.new_elem-alloc {i : nat, n : n, ref^n : ref^n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref <: admininstr)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) - ;; 8-reduction.watsup:606.1-610.15 - rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) (val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) (val <: admininstr) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) - -- otherwise + ;; 8-reduction.watsup:362.1-364.38 + rule array.new_elem-oob {i : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) - ;; 8-reduction.watsup:613.1-615.73 - rule table.copy-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) + ;; 8-reduction.watsup:351.1-354.40 + rule array.new_default {mut : mut, n : n, val : val, x : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) ARRAY.NEW_DEFAULT_admininstr(x)]), (val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ($default($unpacktype(zt)) = ?(val)) - ;; 8-reduction.watsup:617.1-620.14 - rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:348.1-349.70 + rule array.new {n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [(val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.NEW_admininstr(x)]), (val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - ;; 8-reduction.watsup:622.1-627.15 - rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) - -- otherwise - -- if (j <= i) + ;; 8-reduction.watsup:331.1-334.41 + rule struct.get-struct {a : addr, i : nat, mut* : mut*, si : structinst, sx? : sx?, x : idx, z : state, zt* : storagetype*}: + `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]) <: admininstr)]) + -- if ($structinst(z)[a] = si) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - ;; 8-reduction.watsup:629.1-633.15 - rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) - -- otherwise + ;; 8-reduction.watsup:328.1-329.50 + rule struct.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:636.1-638.72 - rule table.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) + ;; 8-reduction.watsup:322.1-325.43 + rule struct.new_default {mut* : mut*, val* : val*, x : idx, z : state, zt* : storagetype*}: + `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val <: admininstr)*{val} :: [STRUCT.NEW_admininstr(x)]) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} - ;; 8-reduction.watsup:640.1-643.14 - rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), []) + ;; 8-reduction.watsup:301.1-303.15 + rule ref.cast-fail {ref : ref, rt : reftype, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) -- otherwise - -- if (n = 0) - ;; 8-reduction.watsup:645.1-649.15 - rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) ($elem(z, y).ELEM_eleminst[i] <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.INIT_admininstr(x, y)]) + ;; 8-reduction.watsup:296.1-299.65 + rule ref.cast-succeed {ref : ref, rt : reftype, rt' : reftype, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref <: admininstr)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt') + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) + + ;; 8-reduction.watsup:291.1-293.15 + rule ref.test-false {ref : ref, rt : reftype, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 8-reduction.watsup:658.1-660.59 - rule load-num-oob {i : nat, mo : memop, nt : numtype, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) - -- if (((i + mo.OFFSET_memop) + ($size(nt <: valtype) / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:286.1-289.65 + rule ref.test-true {ref : ref, rt : reftype, rt' : reftype, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 1)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt') + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) - ;; 8-reduction.watsup:662.1-664.71 - rule load-num-val {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) - -- if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : ($size(nt <: valtype) / 8)]) + ;; 8-reduction.watsup:247.1-248.55 + rule ref.func {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) - ;; 8-reduction.watsup:666.1-668.51 - rule load-pack-oob {i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [TRAP_admininstr]) - -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:182.1-183.91 + rule return_call_ref-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, (val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr <: admininstr)*{instr})]), (val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) - ;; 8-reduction.watsup:670.1-672.61 - rule load-pack-val {c : c, i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [CONST_admininstr(nt, $ext(n, $size(nt <: valtype), sx, c))]) - -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) + ;; 8-reduction.watsup:178.1-180.59 + rule return_call_ref-frame-addr {a : addr, f : frame, instr* : instr*, k : nat, m : m, n : n, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, val'* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' <: admininstr)*{val'} :: (val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr <: admininstr)*{instr})]), (val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - ;; 8-reduction.watsup:692.1-694.44 - rule memory.size {n : n, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) - -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:175.1-176.78 + rule return_call_ref-frame-null {f : frame, ht : heaptype, instr* : instr*, k : nat, val* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val <: admininstr)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr <: admininstr)*{instr})]), [TRAP_admininstr]) - ;; 8-reduction.watsup:705.1-707.37 - rule memory.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:171.1-172.76 + rule return_call {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) RETURN_CALL_REF_admininstr(?())]) - ;; 8-reduction.watsup:709.1-712.14 - rule memory.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:163.1-168.59 + rule call_ref-func {a : addr, f : frame, fi : funcinst, instr* : instr*, m : m, n : n, t* : valtype*, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, x? : idx?, y : idx, z : state}: + `%~>%*`(`%;%*`(z, (val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr <: admininstr)*{instr})])]) + -- if ($funcinst(z)[a] = fi) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) + -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) - ;; 8-reduction.watsup:714.1-718.15 - rule memory.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) (val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (i + 1)) (val <: admininstr) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr(x)]) - -- otherwise + ;; 8-reduction.watsup:160.1-161.43 + rule call_ref-null {ht : heaptype, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) - ;; 8-reduction.watsup:721.1-723.77 - rule memory.copy-oob {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) + ;; 8-reduction.watsup:157.1-158.62 + rule call {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) CALL_REF_admininstr(?())]) - ;; 8-reduction.watsup:725.1-728.14 - rule memory.copy-zero {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), []) + ;; 8-reduction.watsup:150.1-152.15 + rule br_on_cast_fail-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref <: admininstr) BR_admininstr(l)]) -- otherwise - -- if (n = 0) - ;; 8-reduction.watsup:730.1-735.19 - rule memory.copy-le {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, (i_1 + 1)) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) - -- otherwise - -- if (i_1 <= i_2) + ;; 8-reduction.watsup:145.1-148.66 + rule br_on_cast_fail-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref <: admininstr)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt) + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) - ;; 8-reduction.watsup:737.1-741.15 - rule memory.copy-gt {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) + ;; 8-reduction.watsup:140.1-142.15 + rule br_on_cast-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref <: admininstr)]) -- otherwise - ;; 8-reduction.watsup:744.1-746.70 - rule memory.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) + ;; 8-reduction.watsup:135.1-138.66 + rule br_on_cast-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref <: admininstr) BR_admininstr(l)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt) + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) - ;; 8-reduction.watsup:748.1-751.14 - rule memory.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:72.1-74.43 + rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: + `%~>%*`(`%;%*`(z, (val <: admininstr)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], (val <: admininstr)^k{val} :: (instr <: admininstr)*{instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 8-reduction.watsup:753.1-757.15 - rule memory.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, y).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x, y)]) - -- otherwise + ;; 8-reduction.watsup:68.1-70.43 + rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: + `%~>%*`(`%;%*`(z, (val <: admininstr)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], (val <: admininstr)^k{val} :: (instr <: admininstr)*{instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) -;; 8-reduction.watsup:5.1-5.63 -relation Step: `%~>%`(config, config) - ;; 8-reduction.watsup:10.1-12.34 - rule pure {instr* : instr*, instr'* : instr*, z : state}: - `%~>%`(`%;%*`(z, (instr <: admininstr)*{instr}), `%;%*`(z, (instr' <: admininstr)*{instr'})) - -- Step_pure: `%*~>%*`((instr <: admininstr)*{instr}, (instr' <: admininstr)*{instr'}) +;; 8-reduction.watsup:5.1-5.63 +relation Step: `%~>%`(config, config) + ;; 8-reduction.watsup:760.1-761.51 + rule data.drop {x : idx, z : state}: + `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) - ;; 8-reduction.watsup:14.1-16.37 - rule read {instr* : instr*, instr'* : instr*, z : state}: - `%~>%`(`%;%*`(z, (instr <: admininstr)*{instr}), `%;%*`(z, (instr' <: admininstr)*{instr'})) - -- Step_read: `%~>%*`(`%;%*`(z, (instr <: admininstr)*{instr}), (instr' <: admininstr)*{instr'}) + ;; 8-reduction.watsup:701.1-702.77 + rule memory.grow-fail {n : n, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) - ;; 8-reduction.watsup:317.1-320.61 - rule struct.new {mut^n : mut^n, n : n, si : structinst, val^n : val^n, x : idx, z : state, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, (val <: admininstr)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) - -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) + ;; 8-reduction.watsup:697.1-699.40 + rule memory.grow-succeed {mi : meminst, n : n, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, (|$mem(z, x).DATA_meminst| / (64 * $Ki)))])) + -- if (mi = $growmemory($mem(z, x), n)) - ;; 8-reduction.watsup:337.1-338.53 - rule struct.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) (val <: admininstr) STRUCT.SET_admininstr(x, i)]), `%;%*`(z, [TRAP_admininstr])) + ;; 8-reduction.watsup:687.1-689.48 + rule store-pack-val {b* : byte*, c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (n / 8), b*{b}), [])) + -- if (b*{b} = $ibytes(n, $wrap($size(nt <: valtype), n, c))) - ;; 8-reduction.watsup:340.1-343.35 - rule struct.set-struct {a : addr, fv : fieldval, i : nat, mut* : mut*, val : val, x : idx, z : state, zt* : storagetype*}: - `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val <: admininstr) STRUCT.SET_admininstr(x, i)]), `%;%*`($with_struct(z, a, i, fv), [])) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + ;; 8-reduction.watsup:683.1-685.51 + rule store-pack-oob {c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:356.1-359.61 - rule array.new_fixed {ai : arrayinst, mut : mut, n : n, val^n : val^n, x : idx, z : state, zt : storagetype}: - `%~>%`(`%;%*`(z, (val <: admininstr)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) + ;; 8-reduction.watsup:679.1-681.29 + rule store-num-val {b* : byte*, c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), ($size(nt <: valtype) / 8), b*{b}), [])) + -- if (b*{b} = $ntbytes(nt, c)) - ;; 8-reduction.watsup:396.1-397.64 - rule array.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) (val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + ;; 8-reduction.watsup:675.1-677.59 + rule store-num-oob {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + -- if (((i + mo.OFFSET_memop) + ($size(nt <: valtype) / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:399.1-401.38 - rule array.set-oob {a : addr, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) - -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:652.1-653.51 + rule elem.drop {x : idx, z : state}: + `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) - ;; 8-reduction.watsup:403.1-406.31 - rule array.set-array {a : addr, fv : fieldval, i : nat, mut : mut, val : val, x : idx, z : state, zt : storagetype}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) - -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) - -- if (fv = $packval(zt, val)) + ;; 8-reduction.watsup:593.1-594.80 + rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: + `%~>%`(`%;%*`(z, [(ref <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) - ;; 8-reduction.watsup:549.1-550.56 - rule local.set {val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [(val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) + ;; 8-reduction.watsup:589.1-591.46 + rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state}: + `%~>%`(`%;%*`(z, [(ref <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) + -- if (ti = $growtable($table(z, x), n, ref)) - ;; 8-reduction.watsup:561.1-562.58 - rule global.set {val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [(val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) + ;; 8-reduction.watsup:579.1-581.32 + rule table.set-val {i : nat, ref : ref, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) + -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup:575.1-577.33 rule table.set-oob {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:579.1-581.32 - rule table.set-val {i : nat, ref : ref, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) - -- if (i < |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:561.1-562.58 + rule global.set {val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [(val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) - ;; 8-reduction.watsup:589.1-591.46 - rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state}: - `%~>%`(`%;%*`(z, [(ref <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) - -- if (ti = $growtable($table(z, x), n, ref)) + ;; 8-reduction.watsup:549.1-550.56 + rule local.set {val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [(val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) - ;; 8-reduction.watsup:593.1-594.80 - rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: - `%~>%`(`%;%*`(z, [(ref <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) + ;; 8-reduction.watsup:403.1-406.31 + rule array.set-array {a : addr, fv : fieldval, i : nat, mut : mut, val : val, x : idx, z : state, zt : storagetype}: + `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) + -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) + -- if (fv = $packval(zt, val)) - ;; 8-reduction.watsup:652.1-653.51 - rule elem.drop {x : idx, z : state}: - `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) + ;; 8-reduction.watsup:399.1-401.38 + rule array.set-oob {a : addr, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:675.1-677.59 - rule store-num-oob {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if (((i + mo.OFFSET_memop) + ($size(nt <: valtype) / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:396.1-397.64 + rule array.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) (val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) - ;; 8-reduction.watsup:679.1-681.29 - rule store-num-val {b* : byte*, c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), ($size(nt <: valtype) / 8), b*{b}), [])) - -- if (b*{b} = $ntbytes(nt, c)) + ;; 8-reduction.watsup:356.1-359.61 + rule array.new_fixed {ai : arrayinst, mut : mut, n : n, val^n : val^n, x : idx, z : state, zt : storagetype}: + `%~>%`(`%;%*`(z, (val <: admininstr)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) - ;; 8-reduction.watsup:683.1-685.51 - rule store-pack-oob {c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:340.1-343.35 + rule struct.set-struct {a : addr, fv : fieldval, i : nat, mut* : mut*, val : val, x : idx, z : state, zt* : storagetype*}: + `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val <: admininstr) STRUCT.SET_admininstr(x, i)]), `%;%*`($with_struct(z, a, i, fv), [])) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- if (fv = $packval(zt*{zt}[i], val)) - ;; 8-reduction.watsup:687.1-689.48 - rule store-pack-val {b* : byte*, c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (n / 8), b*{b}), [])) - -- if (b*{b} = $ibytes(n, $wrap($size(nt <: valtype), n, c))) + ;; 8-reduction.watsup:337.1-338.53 + rule struct.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) (val <: admininstr) STRUCT.SET_admininstr(x, i)]), `%;%*`(z, [TRAP_admininstr])) - ;; 8-reduction.watsup:697.1-699.40 - rule memory.grow-succeed {mi : meminst, n : n, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, (|$mem(z, x).DATA_meminst| / (64 * $Ki)))])) - -- if (mi = $growmemory($mem(z, x), n)) + ;; 8-reduction.watsup:317.1-320.61 + rule struct.new {mut^n : mut^n, n : n, si : structinst, val^n : val^n, x : idx, z : state, zt^n : storagetype^n}: + `%~>%`(`%;%*`(z, (val <: admininstr)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) + -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) - ;; 8-reduction.watsup:701.1-702.77 - rule memory.grow-fail {n : n, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) + ;; 8-reduction.watsup:14.1-16.37 + rule read {instr* : instr*, instr'* : instr*, z : state}: + `%~>%`(`%;%*`(z, (instr <: admininstr)*{instr}), `%;%*`(z, (instr' <: admininstr)*{instr'})) + -- Step_read: `%~>%*`(`%;%*`(z, (instr <: admininstr)*{instr}), (instr' <: admininstr)*{instr'}) - ;; 8-reduction.watsup:760.1-761.51 - rule data.drop {x : idx, z : state}: - `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) + ;; 8-reduction.watsup:10.1-12.34 + rule pure {instr* : instr*, instr'* : instr*, z : state}: + `%~>%`(`%;%*`(z, (instr <: admininstr)*{instr}), `%;%*`(z, (instr' <: admininstr)*{instr'})) + -- Step_pure: `%*~>%*`((instr <: admininstr)*{instr}, (instr' <: admininstr)*{instr'}) ;; 8-reduction.watsup:8.1-8.63 rec { ;; 8-reduction.watsup:8.1-8.63 relation Steps: `%~>*%`(config, config) - ;; 8-reduction.watsup:18.1-19.36 - rule refl {admininstr* : admininstr*, z : state}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) - ;; 8-reduction.watsup:21.1-24.53 rule trans {admininstr* : admininstr*, admininstr' : admininstr, admininstr''* : admininstr*, z : state, z' : state, z'' : state}: `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z'', admininstr''*{admininstr''})) -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z', admininstr'*{})) -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr''})) + + ;; 8-reduction.watsup:18.1-19.36 + rule refl {admininstr* : admininstr*, z : state}: + `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) } ;; 8-reduction.watsup:29.1-29.69 @@ -3845,14 +4001,14 @@ rec { ;; 9-module.watsup:7.1-7.34 def alloctypes : type* -> deftype* - ;; 9-module.watsup:8.1-8.27 - def alloctypes([]) = [] ;; 9-module.watsup:9.1-13.24 def {deftype* : deftype*, deftype'* : deftype*, rectype : rectype, type : type, type'* : type*, x : idx} alloctypes(type'*{type'} :: [type]) = deftype'*{deftype'} :: deftype*{deftype} -- if (deftype'*{deftype'} = $alloctypes(type'*{type'})) -- if (type = TYPE(rectype)) -- if (deftype*{deftype} = $subst_all_deftypes($rolldt(x, rectype), (deftype' <: heaptype)*{deftype'})) -- if (x = |deftype'*{deftype'}|) + ;; 9-module.watsup:8.1-8.27 + def alloctypes([]) = [] } ;; 9-module.watsup:15.1-15.60 @@ -3867,12 +4023,12 @@ rec { ;; 9-module.watsup:20.1-20.63 def allocfuncs : (store, moduleinst, func*) -> (store, funcaddr*) - ;; 9-module.watsup:21.1-21.39 - def {mm : moduleinst, s : store} allocfuncs(s, mm, []) = (s, []) ;; 9-module.watsup:22.1-24.51 def {fa : funcaddr, fa'* : funcaddr*, func : func, func'* : func*, mm : moduleinst, s : store, s_1 : store, s_2 : store} allocfuncs(s, mm, [func] :: func'*{func'}) = (s_2, [fa] :: fa'*{fa'}) -- if ((s_1, fa) = $allocfunc(s, mm, func)) -- if ((s_2, fa'*{fa'}) = $allocfuncs(s_1, mm, func'*{func'})) + ;; 9-module.watsup:21.1-21.39 + def {mm : moduleinst, s : store} allocfuncs(s, mm, []) = (s, []) } ;; 9-module.watsup:26.1-26.63 @@ -3886,12 +4042,12 @@ rec { ;; 9-module.watsup:30.1-30.67 def allocglobals : (store, globaltype*, val*) -> (store, globaladdr*) - ;; 9-module.watsup:31.1-31.42 - def {s : store} allocglobals(s, [], []) = (s, []) ;; 9-module.watsup:32.1-34.62 def {ga : globaladdr, ga'* : globaladdr*, globaltype : globaltype, globaltype'* : globaltype*, s : store, s_1 : store, s_2 : store, val : val, val'* : val*} allocglobals(s, [globaltype] :: globaltype'*{globaltype'}, [val] :: val'*{val'}) = (s_2, [ga] :: ga'*{ga'}) -- if ((s_1, ga) = $allocglobal(s, globaltype, val)) -- if ((s_2, ga'*{ga'}) = $allocglobals(s_1, globaltype'*{globaltype'}, val'*{val'})) + ;; 9-module.watsup:31.1-31.42 + def {s : store} allocglobals(s, [], []) = (s, []) } ;; 9-module.watsup:36.1-36.60 @@ -3905,12 +4061,12 @@ rec { ;; 9-module.watsup:40.1-40.64 def alloctables : (store, tabletype*, ref*) -> (store, tableaddr*) - ;; 9-module.watsup:41.1-41.41 - def {s : store} alloctables(s, [], []) = (s, []) ;; 9-module.watsup:42.1-44.60 def {ref : ref, ref'* : ref*, s : store, s_1 : store, s_2 : store, ta : tableaddr, ta'* : tableaddr*, tabletype : tabletype, tabletype'* : tabletype*} alloctables(s, [tabletype] :: tabletype'*{tabletype'}, [ref] :: ref'*{ref'}) = (s_2, [ta] :: ta'*{ta'}) -- if ((s_1, ta) = $alloctable(s, tabletype, ref)) -- if ((s_2, ta'*{ta'}) = $alloctables(s_1, tabletype'*{tabletype'}, ref'*{ref'})) + ;; 9-module.watsup:41.1-41.41 + def {s : store} alloctables(s, [], []) = (s, []) } ;; 9-module.watsup:46.1-46.49 @@ -3924,12 +4080,12 @@ rec { ;; 9-module.watsup:50.1-50.52 def allocmems : (store, memtype*) -> (store, memaddr*) - ;; 9-module.watsup:51.1-51.34 - def {s : store} allocmems(s, []) = (s, []) ;; 9-module.watsup:52.1-54.49 def {ma : memaddr, ma'* : memaddr*, memtype : memtype, memtype'* : memtype*, s : store, s_1 : store, s_2 : store} allocmems(s, [memtype] :: memtype'*{memtype'}) = (s_2, [ma] :: ma'*{ma'}) -- if ((s_1, ma) = $allocmem(s, memtype)) -- if ((s_2, ma'*{ma'}) = $allocmems(s_1, memtype'*{memtype'})) + ;; 9-module.watsup:51.1-51.34 + def {s : store} allocmems(s, []) = (s, []) } ;; 9-module.watsup:56.1-56.57 @@ -3943,12 +4099,12 @@ rec { ;; 9-module.watsup:60.1-60.63 def allocelems : (store, reftype*, ref**) -> (store, elemaddr*) - ;; 9-module.watsup:61.1-61.40 - def {s : store} allocelems(s, [], []) = (s, []) ;; 9-module.watsup:62.1-64.55 def {ea : elemaddr, ea'* : elemaddr*, ref* : ref*, ref'** : ref**, rt : reftype, rt'* : reftype*, s : store, s_1 : store, s_2 : store} allocelems(s, [rt] :: rt'*{rt'}, [ref*{ref}] :: ref'*{ref'}*{ref'}) = (s_2, [ea] :: ea'*{ea'}) -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref})) -- if ((s_2, ea'*{ea'}) = $allocelems(s_2, rt'*{rt'}, ref'*{ref'}*{ref'})) + ;; 9-module.watsup:61.1-61.40 + def {s : store} allocelems(s, [], []) = (s, []) } ;; 9-module.watsup:66.1-66.49 @@ -3962,24 +4118,24 @@ rec { ;; 9-module.watsup:70.1-70.54 def allocdatas : (store, byte**) -> (store, dataaddr*) - ;; 9-module.watsup:71.1-71.35 - def {s : store} allocdatas(s, []) = (s, []) ;; 9-module.watsup:72.1-74.50 def {byte* : byte*, byte'** : byte**, da : dataaddr, da'* : dataaddr*, s : store, s_1 : store, s_2 : store} allocdatas(s, [byte*{byte}] :: byte'*{byte'}*{byte'}) = (s_2, [da] :: da'*{da'}) -- if ((s_1, da) = $allocdata(s, byte*{byte})) -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) + ;; 9-module.watsup:71.1-71.35 + def {s : store} allocdatas(s, []) = (s, []) } ;; 9-module.watsup:79.1-79.83 def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst - ;; 9-module.watsup:80.1-80.95 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} - ;; 9-module.watsup:81.1-81.99 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} - ;; 9-module.watsup:82.1-82.97 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} ;; 9-module.watsup:83.1-83.93 def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} + ;; 9-module.watsup:82.1-82.97 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} + ;; 9-module.watsup:81.1-81.99 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} + ;; 9-module.watsup:80.1-80.95 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} ;; 9-module.watsup:86.1-86.87 def allocmodule : (store, module, externval*, val*, ref*, ref**) -> (store, moduleinst) @@ -4011,27 +4167,27 @@ rec { ;; 9-module.watsup:134.1-134.38 def concat_instr : instr** -> instr* - ;; 9-module.watsup:135.1-135.29 - def concat_instr([]) = [] ;; 9-module.watsup:136.1-136.74 def {instr* : instr*, instr'** : instr**} concat_instr([instr*{instr}] :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) + ;; 9-module.watsup:135.1-135.29 + def concat_instr([]) = [] } ;; 9-module.watsup:138.1-138.33 def runelem : (elem, idx) -> instr* - ;; 9-module.watsup:139.1-139.52 - def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, PASSIVE_elemmode), y) = [] - ;; 9-module.watsup:140.1-140.62 - def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] ;; 9-module.watsup:141.1-142.77 def {expr* : expr*, instr* : instr*, reftype : reftype, x : idx, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, ACTIVE_elemmode(x, instr*{instr})), y) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, |expr*{expr}|) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] + ;; 9-module.watsup:140.1-140.62 + def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] + ;; 9-module.watsup:139.1-139.52 + def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, PASSIVE_elemmode), y) = [] ;; 9-module.watsup:144.1-144.33 def rundata : (data, idx) -> instr* - ;; 9-module.watsup:145.1-145.44 - def {byte* : byte*, y : idx} rundata(`DATA%*%`(byte*{byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup:146.1-147.78 def {byte* : byte*, instr* : instr*, x : idx, y : idx} rundata(`DATA%*%`(byte*{byte}, ACTIVE_datamode(x, instr*{instr})), y) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, |byte*{byte}|) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] + ;; 9-module.watsup:145.1-145.44 + def {byte* : byte*, y : idx} rundata(`DATA%*%`(byte*{byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup:149.1-149.53 def instantiate : (store, module, externval*) -> config @@ -4068,20 +4224,20 @@ rec { ;; A-binary.watsup:47.1-47.24 def utf8 : name -> byte* - ;; A-binary.watsup:48.1-48.44 - def {b : byte, c : c} utf8([c]) = [b] - -- if ((c < 128) /\ (c = b)) - ;; A-binary.watsup:49.1-49.93 - def {b_1 : byte, b_2 : byte, c : c} utf8([c]) = [b_1 b_2] - -- if (((128 <= c) /\ (c < 2048)) /\ (c = (((2 ^ 6) * (b_1 - 192)) + (b_2 - 128)))) - ;; A-binary.watsup:50.1-50.144 - def {b_1 : byte, b_2 : byte, b_3 : byte, c : c} utf8([c]) = [b_1 b_2 b_3] - -- if ((((2048 <= c) /\ (c < 55296)) \/ ((57344 <= c) /\ (c < 65536))) /\ (c = ((((2 ^ 12) * (b_1 - 224)) + ((2 ^ 6) * (b_2 - 128))) + (b_3 - 128)))) + ;; A-binary.watsup:52.1-52.41 + def {c* : c*} utf8(c*{c}) = $concat_bytes($utf8([c])*{c}) ;; A-binary.watsup:51.1-51.145 def {b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte, c : c} utf8([c]) = [b_1 b_2 b_3 b_4] -- if (((65536 <= c) /\ (c < 69632)) /\ (c = (((((2 ^ 18) * (b_1 - 240)) + ((2 ^ 12) * (b_2 - 128))) + ((2 ^ 6) * (b_3 - 128))) + (b_4 - 128)))) - ;; A-binary.watsup:52.1-52.41 - def {c* : c*} utf8(c*{c}) = $concat_bytes($utf8([c])*{c}) + ;; A-binary.watsup:50.1-50.144 + def {b_1 : byte, b_2 : byte, b_3 : byte, c : c} utf8([c]) = [b_1 b_2 b_3] + -- if ((((2048 <= c) /\ (c < 55296)) \/ ((57344 <= c) /\ (c < 65536))) /\ (c = ((((2 ^ 12) * (b_1 - 224)) + ((2 ^ 6) * (b_2 - 128))) + (b_3 - 128)))) + ;; A-binary.watsup:49.1-49.93 + def {b_1 : byte, b_2 : byte, c : c} utf8([c]) = [b_1 b_2] + -- if (((128 <= c) /\ (c < 2048)) /\ (c = (((2 ^ 6) * (b_1 - 192)) + (b_2 - 128)))) + ;; A-binary.watsup:48.1-48.44 + def {b : byte, c : c} utf8([c]) = [b] + -- if ((c < 128) /\ (c = b)) } ;; A-binary.watsup:210.1-210.27 @@ -4095,10 +4251,10 @@ rec { ;; A-binary.watsup:665.1-665.62 def concat_locals : local** -> local* - ;; A-binary.watsup:666.1-666.30 - def concat_locals([]) = [] ;; A-binary.watsup:667.1-667.68 def {loc* : local*, loc'** : local**} concat_locals([loc*{loc}] :: loc'*{loc'}*{loc'}) = loc*{loc} :: $concat_locals(loc'*{loc'}*{loc'}) + ;; A-binary.watsup:666.1-666.30 + def concat_locals([]) = [] } ;; A-binary.watsup:670.1-670.29 diff --git a/spectec/test-latex/TEST.md b/spectec/test-latex/TEST.md index ad66ef9b85..7f8d8e4222 100644 --- a/spectec/test-latex/TEST.md +++ b/spectec/test-latex/TEST.md @@ -2,6 +2,8 @@ ```sh $ (dune exec ../src/exe-watsup/main.exe -- test.watsup -o test.tex && cat test.tex) +[elab def] def test_sub_ATOM_22(nat) : nat +[elab def] def curried_(nat, nat) : nat $$ \begin{array}{@{}lcl@{}l@{}} {\mathrm{test}}_{{\mathit{sub}}_{{\mathsf{atom}}_{{22}}}}({\mathit{n}}_{{3}_{{\mathsf{atom}}_{{\mathit{y}}}}}) &=& 0 & \\ @@ -37,6 +39,149 @@ $$ $ (dune exec ../src/exe-watsup/main.exe -- ../spec/wasm-3.0/*.watsup -l -p -d spec-splice.in.tex -w) == Parsing... == Elaboration... +[elab def] def Ki : nat +[elab def] def min(nat, nat) : nat +[elab def] def sum(nat*) : nat +[elab def] def signif(N) : nat +[elab def] def expon(N) : nat +[elab def] def M(N) : nat +[elab def] def E(N) : nat +[elab def] def fzero(N) : fN(N) +[elab def] def setminus(idx*, idx*) : idx* +[elab def] def setminus1(idx, idx*) : idx* +[elab def] def free_dataidx_instr(instr) : dataidx* +[elab def] def free_dataidx_instrs(instr*) : dataidx* +[elab def] def free_dataidx_expr(expr) : dataidx* +[elab def] def free_dataidx_func(func) : dataidx* +[elab def] def free_dataidx_funcs(func*) : dataidx* +[elab def] def concat_bytes((byte*)*) : byte* +[elab def] def size(valtype) : nat +[elab def] def packedsize(packedtype) : nat +[elab def] def storagesize(storagetype) : nat +[elab def] def unpacktype(storagetype) : valtype +[elab def] def unpacknumtype(storagetype) : numtype +[elab def] def sxfield(storagetype) : sx? +[elab def] def diffrt(reftype, reftype) : reftype +[elab def] def idx(typeidx) : typevar +[elab def] def subst_typevar(typevar, typevar*, heaptype*) : heaptype +[elab def] def subst_numtype(numtype, typevar*, heaptype*) : numtype +[elab def] def subst_vectype(vectype, typevar*, heaptype*) : vectype +[elab def] def subst_heaptype(heaptype, typevar*, heaptype*) : heaptype +[elab def] def subst_reftype(reftype, typevar*, heaptype*) : reftype +[elab def] def subst_valtype(valtype, typevar*, heaptype*) : valtype +[elab def] def subst_packedtype(packedtype, typevar*, heaptype*) : packedtype +[elab def] def subst_storagetype(storagetype, typevar*, heaptype*) : storagetype +[elab def] def subst_fieldtype(fieldtype, typevar*, heaptype*) : fieldtype +[elab def] def subst_comptype(comptype, typevar*, heaptype*) : comptype +[elab def] def subst_subtype(subtype, typevar*, heaptype*) : subtype +[elab def] def subst_rectype(rectype, typevar*, heaptype*) : rectype +[elab def] def subst_deftype(deftype, typevar*, heaptype*) : deftype +[elab def] def subst_globaltype(globaltype, typevar*, heaptype*) : globaltype +[elab def] def subst_functype(functype, typevar*, heaptype*) : functype +[elab def] def subst_tabletype(tabletype, typevar*, heaptype*) : tabletype +[elab def] def subst_memtype(memtype, typevar*, heaptype*) : memtype +[elab def] def subst_externtype(externtype, typevar*, heaptype*) : externtype +[elab def] def subst_all_reftype(reftype, heaptype*) : reftype +[elab def] def subst_all_deftype(deftype, heaptype*) : deftype +[elab def] def subst_all_deftypes(deftype*, heaptype*) : deftype* +[elab def] def rollrt(typeidx, rectype) : rectype +[elab def] def unrollrt(rectype) : rectype +[elab def] def rolldt(typeidx, rectype) : deftype* +[elab def] def unrolldt(deftype) : subtype +[elab def] def expanddt(deftype) : comptype +[elab def] def funcsxt(externtype*) : deftype* +[elab def] def globalsxt(externtype*) : globaltype* +[elab def] def tablesxt(externtype*) : tabletype* +[elab def] def memsxt(externtype*) : memtype* +[elab def] def memop0 : memop +[elab def] def s33_to_u32(s33) : u32 +[elab def] def signed(N, nat) : int +[elab def] def invsigned(N, int) : nat +[elab def] def unop(unop_numtype, numtype, c) : c_numtype* +[elab def] def binop(binop_numtype, numtype, c, c) : c_numtype* +[elab def] def testop(testop_numtype, numtype, c) : c_numtype +[elab def] def relop(relop_numtype, numtype, c, c) : c_numtype +[elab def] def cvtop(cvtop, numtype, numtype, sx?, c) : c_numtype* +[elab def] def wrap(nat, nat, c) : nat +[elab def] def ext(nat, nat, sx, c) : c_numtype +[elab def] def ibytes(N, iN(N)) : byte* +[elab def] def fbytes(N, fN(N)) : byte* +[elab def] def ntbytes(numtype, c) : byte* +[elab def] def ztbytes(storagetype, c) : byte* +[elab def] def invibytes(N, byte*) : iN(N) +[elab def] def invfbytes(N, byte*) : fN(N) +[elab def] def inst_reftype(moduleinst, reftype) : reftype +[elab def] def default(valtype) : val? +[elab def] def packval(storagetype, val) : fieldval +[elab def] def unpackval(storagetype, sx?, fieldval) : val +[elab def] def funcsxv(externval*) : funcaddr* +[elab def] def globalsxv(externval*) : globaladdr* +[elab def] def tablesxv(externval*) : tableaddr* +[elab def] def memsxv(externval*) : memaddr* +[elab def] def store(state) : store +[elab def] def frame(state) : frame +[elab def] def funcaddr(state) : funcaddr* +[elab def] def funcinst(state) : funcinst* +[elab def] def globalinst(state) : globalinst* +[elab def] def tableinst(state) : tableinst* +[elab def] def meminst(state) : meminst* +[elab def] def eleminst(state) : eleminst* +[elab def] def datainst(state) : datainst* +[elab def] def structinst(state) : structinst* +[elab def] def arrayinst(state) : arrayinst* +[elab def] def moduleinst(state) : moduleinst +[elab def] def type(state, typeidx) : deftype +[elab def] def func(state, funcidx) : funcinst +[elab def] def global(state, globalidx) : globalinst +[elab def] def table(state, tableidx) : tableinst +[elab def] def mem(state, memidx) : meminst +[elab def] def elem(state, tableidx) : eleminst +[elab def] def data(state, dataidx) : datainst +[elab def] def local(state, localidx) : val? +[elab def] def with_local(state, localidx, val) : state +[elab def] def with_global(state, globalidx, val) : state +[elab def] def with_table(state, tableidx, nat, ref) : state +[elab def] def with_tableinst(state, tableidx, tableinst) : state +[elab def] def with_mem(state, memidx, nat, nat, byte*) : state +[elab def] def with_meminst(state, memidx, meminst) : state +[elab def] def with_elem(state, elemidx, ref*) : state +[elab def] def with_data(state, dataidx, byte*) : state +[elab def] def with_struct(state, structaddr, nat, fieldval) : state +[elab def] def with_array(state, arrayaddr, nat, fieldval) : state +[elab def] def ext_structinst(state, structinst*) : state +[elab def] def ext_arrayinst(state, arrayinst*) : state +[elab def] def growtable(tableinst, nat, ref) : tableinst +[elab def] def growmemory(meminst, nat) : meminst +[elab def] def with_locals(context, localidx*, localtype*) : context +[elab def] def clostype(context, deftype) : deftype +[elab def] def clostypes(deftype*) : deftype* +[elab def] def before(heaptype, typeidx, nat) : bool +[elab def] def unrollht(context, heaptype) : subtype +[elab def] def in_numtype(numtype, numtype*) : bool +[elab def] def in_binop(binop_numtype, ibinop*) : bool +[elab def] def blocktype(state, blocktype) : functype +[elab def] def alloctypes(type*) : deftype* +[elab def] def allocfunc(store, moduleinst, func) : (store, funcaddr) +[elab def] def allocfuncs(store, moduleinst, func*) : (store, funcaddr*) +[elab def] def allocglobal(store, globaltype, val) : (store, globaladdr) +[elab def] def allocglobals(store, globaltype*, val*) : (store, globaladdr*) +[elab def] def alloctable(store, tabletype, ref) : (store, tableaddr) +[elab def] def alloctables(store, tabletype*, ref*) : (store, tableaddr*) +[elab def] def allocmem(store, memtype) : (store, memaddr) +[elab def] def allocmems(store, memtype*) : (store, memaddr*) +[elab def] def allocelem(store, reftype, ref*) : (store, elemaddr) +[elab def] def allocelems(store, reftype*, (ref*)*) : (store, elemaddr*) +[elab def] def allocdata(store, byte*) : (store, dataaddr) +[elab def] def allocdatas(store, (byte*)*) : (store, dataaddr*) +[elab def] def instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export) : exportinst +[elab def] def allocmodule(store, module, externval*, val*, ref*, (ref*)*) : (store, moduleinst) +[elab def] def concat_instr((instr*)*) : instr* +[elab def] def runelem(elem, idx) : instr* +[elab def] def rundata(data, idx) : instr* +[elab def] def instantiate(store, module, externval*) : config +[elab def] def invoke(store, funcaddr, val*) : config +[elab def] def utf8(name) : byte* +[elab def] def concat_locals((local*)*) : local* == IL Validation... == Latex Generation... warning: syntax `E` was never spliced diff --git a/spectec/test-middlend/TEST.md b/spectec/test-middlend/TEST.md index 7c4dc5ae84..74f4313746 100644 --- a/spectec/test-middlend/TEST.md +++ b/spectec/test-middlend/TEST.md @@ -4,6 +4,149 @@ $ (cd ../spec/wasm-3.0 && ../../src/exe-watsup/main.exe *.watsup -l --print-all-il --all-passes --check) == Parsing... == Elaboration... +[elab def] def Ki : nat +[elab def] def min(nat, nat) : nat +[elab def] def sum(nat*) : nat +[elab def] def signif(N) : nat +[elab def] def expon(N) : nat +[elab def] def M(N) : nat +[elab def] def E(N) : nat +[elab def] def fzero(N) : fN(N) +[elab def] def setminus(idx*, idx*) : idx* +[elab def] def setminus1(idx, idx*) : idx* +[elab def] def free_dataidx_instr(instr) : dataidx* +[elab def] def free_dataidx_instrs(instr*) : dataidx* +[elab def] def free_dataidx_expr(expr) : dataidx* +[elab def] def free_dataidx_func(func) : dataidx* +[elab def] def free_dataidx_funcs(func*) : dataidx* +[elab def] def concat_bytes((byte*)*) : byte* +[elab def] def size(valtype) : nat +[elab def] def packedsize(packedtype) : nat +[elab def] def storagesize(storagetype) : nat +[elab def] def unpacktype(storagetype) : valtype +[elab def] def unpacknumtype(storagetype) : numtype +[elab def] def sxfield(storagetype) : sx? +[elab def] def diffrt(reftype, reftype) : reftype +[elab def] def idx(typeidx) : typevar +[elab def] def subst_typevar(typevar, typevar*, heaptype*) : heaptype +[elab def] def subst_numtype(numtype, typevar*, heaptype*) : numtype +[elab def] def subst_vectype(vectype, typevar*, heaptype*) : vectype +[elab def] def subst_heaptype(heaptype, typevar*, heaptype*) : heaptype +[elab def] def subst_reftype(reftype, typevar*, heaptype*) : reftype +[elab def] def subst_valtype(valtype, typevar*, heaptype*) : valtype +[elab def] def subst_packedtype(packedtype, typevar*, heaptype*) : packedtype +[elab def] def subst_storagetype(storagetype, typevar*, heaptype*) : storagetype +[elab def] def subst_fieldtype(fieldtype, typevar*, heaptype*) : fieldtype +[elab def] def subst_comptype(comptype, typevar*, heaptype*) : comptype +[elab def] def subst_subtype(subtype, typevar*, heaptype*) : subtype +[elab def] def subst_rectype(rectype, typevar*, heaptype*) : rectype +[elab def] def subst_deftype(deftype, typevar*, heaptype*) : deftype +[elab def] def subst_globaltype(globaltype, typevar*, heaptype*) : globaltype +[elab def] def subst_functype(functype, typevar*, heaptype*) : functype +[elab def] def subst_tabletype(tabletype, typevar*, heaptype*) : tabletype +[elab def] def subst_memtype(memtype, typevar*, heaptype*) : memtype +[elab def] def subst_externtype(externtype, typevar*, heaptype*) : externtype +[elab def] def subst_all_reftype(reftype, heaptype*) : reftype +[elab def] def subst_all_deftype(deftype, heaptype*) : deftype +[elab def] def subst_all_deftypes(deftype*, heaptype*) : deftype* +[elab def] def rollrt(typeidx, rectype) : rectype +[elab def] def unrollrt(rectype) : rectype +[elab def] def rolldt(typeidx, rectype) : deftype* +[elab def] def unrolldt(deftype) : subtype +[elab def] def expanddt(deftype) : comptype +[elab def] def funcsxt(externtype*) : deftype* +[elab def] def globalsxt(externtype*) : globaltype* +[elab def] def tablesxt(externtype*) : tabletype* +[elab def] def memsxt(externtype*) : memtype* +[elab def] def memop0 : memop +[elab def] def s33_to_u32(s33) : u32 +[elab def] def signed(N, nat) : int +[elab def] def invsigned(N, int) : nat +[elab def] def unop(unop_numtype, numtype, c) : c_numtype* +[elab def] def binop(binop_numtype, numtype, c, c) : c_numtype* +[elab def] def testop(testop_numtype, numtype, c) : c_numtype +[elab def] def relop(relop_numtype, numtype, c, c) : c_numtype +[elab def] def cvtop(cvtop, numtype, numtype, sx?, c) : c_numtype* +[elab def] def wrap(nat, nat, c) : nat +[elab def] def ext(nat, nat, sx, c) : c_numtype +[elab def] def ibytes(N, iN(N)) : byte* +[elab def] def fbytes(N, fN(N)) : byte* +[elab def] def ntbytes(numtype, c) : byte* +[elab def] def ztbytes(storagetype, c) : byte* +[elab def] def invibytes(N, byte*) : iN(N) +[elab def] def invfbytes(N, byte*) : fN(N) +[elab def] def inst_reftype(moduleinst, reftype) : reftype +[elab def] def default(valtype) : val? +[elab def] def packval(storagetype, val) : fieldval +[elab def] def unpackval(storagetype, sx?, fieldval) : val +[elab def] def funcsxv(externval*) : funcaddr* +[elab def] def globalsxv(externval*) : globaladdr* +[elab def] def tablesxv(externval*) : tableaddr* +[elab def] def memsxv(externval*) : memaddr* +[elab def] def store(state) : store +[elab def] def frame(state) : frame +[elab def] def funcaddr(state) : funcaddr* +[elab def] def funcinst(state) : funcinst* +[elab def] def globalinst(state) : globalinst* +[elab def] def tableinst(state) : tableinst* +[elab def] def meminst(state) : meminst* +[elab def] def eleminst(state) : eleminst* +[elab def] def datainst(state) : datainst* +[elab def] def structinst(state) : structinst* +[elab def] def arrayinst(state) : arrayinst* +[elab def] def moduleinst(state) : moduleinst +[elab def] def type(state, typeidx) : deftype +[elab def] def func(state, funcidx) : funcinst +[elab def] def global(state, globalidx) : globalinst +[elab def] def table(state, tableidx) : tableinst +[elab def] def mem(state, memidx) : meminst +[elab def] def elem(state, tableidx) : eleminst +[elab def] def data(state, dataidx) : datainst +[elab def] def local(state, localidx) : val? +[elab def] def with_local(state, localidx, val) : state +[elab def] def with_global(state, globalidx, val) : state +[elab def] def with_table(state, tableidx, nat, ref) : state +[elab def] def with_tableinst(state, tableidx, tableinst) : state +[elab def] def with_mem(state, memidx, nat, nat, byte*) : state +[elab def] def with_meminst(state, memidx, meminst) : state +[elab def] def with_elem(state, elemidx, ref*) : state +[elab def] def with_data(state, dataidx, byte*) : state +[elab def] def with_struct(state, structaddr, nat, fieldval) : state +[elab def] def with_array(state, arrayaddr, nat, fieldval) : state +[elab def] def ext_structinst(state, structinst*) : state +[elab def] def ext_arrayinst(state, arrayinst*) : state +[elab def] def growtable(tableinst, nat, ref) : tableinst +[elab def] def growmemory(meminst, nat) : meminst +[elab def] def with_locals(context, localidx*, localtype*) : context +[elab def] def clostype(context, deftype) : deftype +[elab def] def clostypes(deftype*) : deftype* +[elab def] def before(heaptype, typeidx, nat) : bool +[elab def] def unrollht(context, heaptype) : subtype +[elab def] def in_numtype(numtype, numtype*) : bool +[elab def] def in_binop(binop_numtype, ibinop*) : bool +[elab def] def blocktype(state, blocktype) : functype +[elab def] def alloctypes(type*) : deftype* +[elab def] def allocfunc(store, moduleinst, func) : (store, funcaddr) +[elab def] def allocfuncs(store, moduleinst, func*) : (store, funcaddr*) +[elab def] def allocglobal(store, globaltype, val) : (store, globaladdr) +[elab def] def allocglobals(store, globaltype*, val*) : (store, globaladdr*) +[elab def] def alloctable(store, tabletype, ref) : (store, tableaddr) +[elab def] def alloctables(store, tabletype*, ref*) : (store, tableaddr*) +[elab def] def allocmem(store, memtype) : (store, memaddr) +[elab def] def allocmems(store, memtype*) : (store, memaddr*) +[elab def] def allocelem(store, reftype, ref*) : (store, elemaddr) +[elab def] def allocelems(store, reftype*, (ref*)*) : (store, elemaddr*) +[elab def] def allocdata(store, byte*) : (store, dataaddr) +[elab def] def allocdatas(store, (byte*)*) : (store, dataaddr*) +[elab def] def instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export) : exportinst +[elab def] def allocmodule(store, module, externval*, val*, ref*, (ref*)*) : (store, moduleinst) +[elab def] def concat_instr((instr*)*) : instr* +[elab def] def runelem(elem, idx) : instr* +[elab def] def rundata(data, idx) : instr* +[elab def] def instantiate(store, module, externval*) : config +[elab def] def invoke(store, funcaddr, val*) : config +[elab def] def utf8(name) : byte* +[elab def] def concat_locals((local*)*) : local* ;; 0-aux.watsup:11.1-11.15 syntax N = nat @@ -27,12 +170,12 @@ rec { ;; 0-aux.watsup:27.1-27.25 def min : (nat, nat) -> nat - ;; 0-aux.watsup:28.1-28.19 - def {j : nat} min(0, j) = 0 - ;; 0-aux.watsup:29.1-29.19 - def {i : nat} min(i, 0) = 0 ;; 0-aux.watsup:30.1-30.38 def {i : nat, j : nat} min((i + 1), (j + 1)) = $min(i, j) + ;; 0-aux.watsup:29.1-29.19 + def {i : nat} min(i, 0) = 0 + ;; 0-aux.watsup:28.1-28.19 + def {j : nat} min(0, j) = 0 } ;; 0-aux.watsup:32.1-32.21 @@ -40,10 +183,10 @@ rec { ;; 0-aux.watsup:32.1-32.21 def sum : nat* -> nat - ;; 0-aux.watsup:33.1-33.18 - def sum([]) = 0 ;; 0-aux.watsup:34.1-34.35 def {n : n, n'* : n*} sum([n] :: n'*{n'}) = (n + $sum(n'*{n'})) + ;; 0-aux.watsup:33.1-33.18 + def sum([]) = 0 } ;; 1-syntax.watsup:5.1-5.85 @@ -81,17 +224,17 @@ syntax s33 = sN ;; 1-syntax.watsup:35.1-35.21 def signif : N -> nat - ;; 1-syntax.watsup:36.1-36.21 - def signif(32) = 23 ;; 1-syntax.watsup:37.1-37.21 def signif(64) = 52 + ;; 1-syntax.watsup:36.1-36.21 + def signif(32) = 23 ;; 1-syntax.watsup:39.1-39.20 def expon : N -> nat - ;; 1-syntax.watsup:40.1-40.19 - def expon(32) = 8 ;; 1-syntax.watsup:41.1-41.20 def expon(64) = 11 + ;; 1-syntax.watsup:40.1-40.19 + def expon(32) = 8 ;; 1-syntax.watsup:43.1-43.35 def M : N -> nat @@ -568,14 +711,14 @@ rec { ;; 2-syntax-aux.watsup:8.1-8.33 def setminus1 : (idx, idx*) -> idx* - ;; 2-syntax-aux.watsup:13.1-13.27 - def {x : idx} setminus1(x, []) = [x] - ;; 2-syntax-aux.watsup:14.1-14.57 - def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = [] - -- if (x = y_1) ;; 2-syntax-aux.watsup:15.1-15.60 def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = $setminus1(x, y*{y}) -- otherwise + ;; 2-syntax-aux.watsup:14.1-14.57 + def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = [] + -- if (x = y_1) + ;; 2-syntax-aux.watsup:13.1-13.27 + def {x : idx} setminus1(x, []) = [x] } ;; 2-syntax-aux.watsup:7.1-7.49 @@ -583,30 +726,30 @@ rec { ;; 2-syntax-aux.watsup:7.1-7.49 def setminus : (idx*, idx*) -> idx* - ;; 2-syntax-aux.watsup:10.1-10.29 - def {y* : idx*} setminus([], y*{y}) = [] ;; 2-syntax-aux.watsup:11.1-11.66 def {x* : idx*, x_1 : idx, y* : idx*} setminus([x_1] :: x*{x}, y*{y}) = $setminus1(x_1, y*{y}) :: $setminus(x*{x}, y*{y}) + ;; 2-syntax-aux.watsup:10.1-10.29 + def {y* : idx*} setminus([], y*{y}) = [] } ;; 2-syntax-aux.watsup:20.1-20.68 def free_dataidx_instr : instr -> dataidx* - ;; 2-syntax-aux.watsup:21.1-21.45 - def {x : idx, y : idx} free_dataidx_instr(MEMORY.INIT_instr(x, y)) = [y] - ;; 2-syntax-aux.watsup:22.1-22.41 - def {x : idx} free_dataidx_instr(DATA.DROP_instr(x)) = [x] ;; 2-syntax-aux.watsup:23.1-23.34 def {in : instr} free_dataidx_instr(in) = [] + ;; 2-syntax-aux.watsup:22.1-22.41 + def {x : idx} free_dataidx_instr(DATA.DROP_instr(x)) = [x] + ;; 2-syntax-aux.watsup:21.1-21.45 + def {x : idx, y : idx} free_dataidx_instr(MEMORY.INIT_instr(x, y)) = [y] ;; 2-syntax-aux.watsup:25.1-25.70 rec { ;; 2-syntax-aux.watsup:25.1-25.70 def free_dataidx_instrs : instr* -> dataidx* - ;; 2-syntax-aux.watsup:26.1-26.36 - def free_dataidx_instrs([]) = [] ;; 2-syntax-aux.watsup:27.1-27.99 def {instr : instr, instr'* : instr*} free_dataidx_instrs([instr] :: instr'*{instr'}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr'}) + ;; 2-syntax-aux.watsup:26.1-26.36 + def free_dataidx_instrs([]) = [] } ;; 2-syntax-aux.watsup:29.1-29.66 @@ -624,10 +767,10 @@ rec { ;; 2-syntax-aux.watsup:35.1-35.68 def free_dataidx_funcs : func* -> dataidx* - ;; 2-syntax-aux.watsup:36.1-36.35 - def free_dataidx_funcs([]) = [] ;; 2-syntax-aux.watsup:37.1-37.92 def {func : func, func'* : func*} free_dataidx_funcs([func] :: func'*{func'}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func'}) + ;; 2-syntax-aux.watsup:36.1-36.35 + def free_dataidx_funcs([]) = [] } ;; 2-syntax-aux.watsup:46.1-46.59 @@ -635,66 +778,66 @@ rec { ;; 2-syntax-aux.watsup:46.1-46.59 def concat_bytes : byte** -> byte* - ;; 2-syntax-aux.watsup:47.1-47.29 - def concat_bytes([]) = [] ;; 2-syntax-aux.watsup:48.1-48.58 def {b* : byte*, b'** : byte**} concat_bytes([b*{b}] :: b'*{b'}*{b'}) = b*{b} :: $concat_bytes(b'*{b'}*{b'}) + ;; 2-syntax-aux.watsup:47.1-47.29 + def concat_bytes([]) = [] } ;; 2-syntax-aux.watsup:59.1-59.55 def size : valtype -> nat - ;; 2-syntax-aux.watsup:60.1-60.20 - def size(I32_valtype) = 32 - ;; 2-syntax-aux.watsup:61.1-61.20 - def size(I64_valtype) = 64 - ;; 2-syntax-aux.watsup:62.1-62.20 - def size(F32_valtype) = 32 - ;; 2-syntax-aux.watsup:63.1-63.20 - def size(F64_valtype) = 64 ;; 2-syntax-aux.watsup:64.1-64.22 def size(V128_valtype) = 128 + ;; 2-syntax-aux.watsup:63.1-63.20 + def size(F64_valtype) = 64 + ;; 2-syntax-aux.watsup:62.1-62.20 + def size(F32_valtype) = 32 + ;; 2-syntax-aux.watsup:61.1-61.20 + def size(I64_valtype) = 64 + ;; 2-syntax-aux.watsup:60.1-60.20 + def size(I32_valtype) = 32 ;; 2-syntax-aux.watsup:66.1-66.50 def packedsize : packedtype -> nat - ;; 2-syntax-aux.watsup:67.1-67.24 - def packedsize(I8_packedtype) = 8 ;; 2-syntax-aux.watsup:68.1-68.26 def packedsize(I16_packedtype) = 16 + ;; 2-syntax-aux.watsup:67.1-67.24 + def packedsize(I8_packedtype) = 8 ;; 2-syntax-aux.watsup:70.1-70.52 def storagesize : storagetype -> nat - ;; 2-syntax-aux.watsup:71.1-71.43 - def {valtype : valtype} storagesize(valtype <: storagetype) = $size(valtype) ;; 2-syntax-aux.watsup:72.1-72.55 def {packedtype : packedtype} storagesize(packedtype <: storagetype) = $packedsize(packedtype) + ;; 2-syntax-aux.watsup:71.1-71.43 + def {valtype : valtype} storagesize(valtype <: storagetype) = $size(valtype) ;; 2-syntax-aux.watsup:77.1-77.62 def unpacktype : storagetype -> valtype - ;; 2-syntax-aux.watsup:78.1-78.35 - def {valtype : valtype} unpacktype(valtype <: storagetype) = valtype ;; 2-syntax-aux.watsup:79.1-79.34 def {packedtype : packedtype} unpacktype(packedtype <: storagetype) = I32_valtype + ;; 2-syntax-aux.watsup:78.1-78.35 + def {valtype : valtype} unpacktype(valtype <: storagetype) = valtype ;; 2-syntax-aux.watsup:81.1-81.65 def unpacknumtype : storagetype -> numtype - ;; 2-syntax-aux.watsup:82.1-82.38 - def {numtype : numtype} unpacknumtype(numtype <: storagetype) = numtype ;; 2-syntax-aux.watsup:83.1-83.37 def {packedtype : packedtype} unpacknumtype(packedtype <: storagetype) = I32_numtype + ;; 2-syntax-aux.watsup:82.1-82.38 + def {numtype : numtype} unpacknumtype(numtype <: storagetype) = numtype ;; 2-syntax-aux.watsup:85.1-85.51 def sxfield : storagetype -> sx? - ;; 2-syntax-aux.watsup:86.1-86.28 - def {valtype : valtype} sxfield(valtype <: storagetype) = ?() ;; 2-syntax-aux.watsup:87.1-87.29 def {packedtype : packedtype} sxfield(packedtype <: storagetype) = ?(S_sx) + ;; 2-syntax-aux.watsup:86.1-86.28 + def {valtype : valtype} sxfield(valtype <: storagetype) = ?() ;; 2-syntax-aux.watsup:92.1-92.59 def diffrt : (reftype, reftype) -> reftype - ;; 2-syntax-aux.watsup:94.1-94.64 - def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) = REF_reftype(`NULL%?`(?()), ht_1) ;; 2-syntax-aux.watsup:95.1-95.65 def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?()), ht_2)) = REF_reftype(nul_1, ht_1) + ;; 2-syntax-aux.watsup:94.1-94.64 + def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) = REF_reftype(`NULL%?`(?()), ht_1) ;; 2-syntax-aux.watsup:100.1-100.42 syntax typevar = @@ -711,14 +854,14 @@ rec { ;; 2-syntax-aux.watsup:109.1-109.92 def subst_typevar : (typevar, typevar*, heaptype*) -> heaptype - ;; 2-syntax-aux.watsup:134.1-134.38 - def {xx : typevar} subst_typevar(xx, [], []) = (xx <: heaptype) - ;; 2-syntax-aux.watsup:135.1-135.95 - def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 - -- if (xx = xx_1) ;; 2-syntax-aux.watsup:136.1-136.92 def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = $subst_typevar(xx, xx'*{xx'}, ht'*{ht'}) -- otherwise + ;; 2-syntax-aux.watsup:135.1-135.95 + def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 + -- if (xx = xx_1) + ;; 2-syntax-aux.watsup:134.1-134.38 + def {xx : typevar} subst_typevar(xx, [], []) = (xx <: heaptype) } ;; 2-syntax-aux.watsup:111.1-111.92 @@ -741,13 +884,13 @@ rec { ;; 2-syntax-aux.watsup:113.1-113.92 def subst_heaptype : (heaptype, typevar*, heaptype*) -> heaptype - ;; 2-syntax-aux.watsup:141.1-141.67 - def {ht* : heaptype*, xx* : typevar*, xx' : typevar} subst_heaptype((xx' <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) - ;; 2-syntax-aux.watsup:142.1-142.65 - def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_heaptype((dt <: heaptype), xx*{xx}, ht*{ht}) = ($subst_deftype(dt, xx*{xx}, ht*{ht}) <: heaptype) ;; 2-syntax-aux.watsup:143.1-143.55 def {ht* : heaptype*, ht' : heaptype, xx* : typevar*} subst_heaptype(ht', xx*{xx}, ht*{ht}) = ht' -- otherwise + ;; 2-syntax-aux.watsup:142.1-142.65 + def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_heaptype((dt <: heaptype), xx*{xx}, ht*{ht}) = ($subst_deftype(dt, xx*{xx}, ht*{ht}) <: heaptype) + ;; 2-syntax-aux.watsup:141.1-141.67 + def {ht* : heaptype*, xx* : typevar*, xx' : typevar} subst_heaptype((xx' <: heaptype), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) ;; 2-syntax-aux.watsup:114.1-114.92 def subst_reftype : (reftype, typevar*, heaptype*) -> reftype @@ -756,21 +899,21 @@ def subst_reftype : (reftype, typevar*, heaptype*) -> reftype ;; 2-syntax-aux.watsup:115.1-115.92 def subst_valtype : (valtype, typevar*, heaptype*) -> valtype - ;; 2-syntax-aux.watsup:147.1-147.64 - def {ht* : heaptype*, nt : numtype, xx* : typevar*} subst_valtype((nt <: valtype), xx*{xx}, ht*{ht}) = ($subst_numtype(nt, xx*{xx}, ht*{ht}) <: valtype) - ;; 2-syntax-aux.watsup:148.1-148.64 - def {ht* : heaptype*, vt : vectype, xx* : typevar*} subst_valtype((vt <: valtype), xx*{xx}, ht*{ht}) = ($subst_vectype(vt, xx*{xx}, ht*{ht}) <: valtype) - ;; 2-syntax-aux.watsup:149.1-149.64 - def {ht* : heaptype*, rt : reftype, xx* : typevar*} subst_valtype((rt <: valtype), xx*{xx}, ht*{ht}) = ($subst_reftype(rt, xx*{xx}, ht*{ht}) <: valtype) ;; 2-syntax-aux.watsup:150.1-150.40 def {ht* : heaptype*, xx* : typevar*} subst_valtype(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + ;; 2-syntax-aux.watsup:149.1-149.64 + def {ht* : heaptype*, rt : reftype, xx* : typevar*} subst_valtype((rt <: valtype), xx*{xx}, ht*{ht}) = ($subst_reftype(rt, xx*{xx}, ht*{ht}) <: valtype) + ;; 2-syntax-aux.watsup:148.1-148.64 + def {ht* : heaptype*, vt : vectype, xx* : typevar*} subst_valtype((vt <: valtype), xx*{xx}, ht*{ht}) = ($subst_vectype(vt, xx*{xx}, ht*{ht}) <: valtype) + ;; 2-syntax-aux.watsup:147.1-147.64 + def {ht* : heaptype*, nt : numtype, xx* : typevar*} subst_valtype((nt <: valtype), xx*{xx}, ht*{ht}) = ($subst_numtype(nt, xx*{xx}, ht*{ht}) <: valtype) ;; 2-syntax-aux.watsup:118.1-118.92 def subst_storagetype : (storagetype, typevar*, heaptype*) -> storagetype - ;; 2-syntax-aux.watsup:154.1-154.66 - def {ht* : heaptype*, t : valtype, xx* : typevar*} subst_storagetype((t <: storagetype), xx*{xx}, ht*{ht}) = ($subst_valtype(t, xx*{xx}, ht*{ht}) <: storagetype) ;; 2-syntax-aux.watsup:155.1-155.71 def {ht* : heaptype*, pt : packedtype, xx* : typevar*} subst_storagetype((pt <: storagetype), xx*{xx}, ht*{ht}) = ($subst_packedtype(pt, xx*{xx}, ht*{ht}) <: storagetype) + ;; 2-syntax-aux.watsup:154.1-154.66 + def {ht* : heaptype*, t : valtype, xx* : typevar*} subst_storagetype((t <: storagetype), xx*{xx}, ht*{ht}) = ($subst_valtype(t, xx*{xx}, ht*{ht}) <: storagetype) ;; 2-syntax-aux.watsup:119.1-119.92 def subst_fieldtype : (fieldtype, typevar*, heaptype*) -> fieldtype @@ -779,19 +922,19 @@ def subst_fieldtype : (fieldtype, typevar*, heaptype*) -> fieldtype ;; 2-syntax-aux.watsup:121.1-121.92 def subst_comptype : (comptype, typevar*, heaptype*) -> comptype - ;; 2-syntax-aux.watsup:159.1-159.85 - def {ht* : heaptype*, xx* : typevar*, yt* : fieldtype*} subst_comptype(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) - ;; 2-syntax-aux.watsup:160.1-160.81 - def {ht* : heaptype*, xx* : typevar*, yt : fieldtype} subst_comptype(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:161.1-161.78 def {ft : functype, ht* : heaptype*, xx* : typevar*} subst_comptype(FUNC_comptype(ft), xx*{xx}, ht*{ht}) = FUNC_comptype($subst_functype(ft, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:160.1-160.81 + def {ht* : heaptype*, xx* : typevar*, yt : fieldtype} subst_comptype(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:159.1-159.85 + def {ht* : heaptype*, xx* : typevar*, yt* : fieldtype*} subst_comptype(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) ;; 2-syntax-aux.watsup:122.1-122.92 def subst_subtype : (subtype, typevar*, heaptype*) -> subtype - ;; 2-syntax-aux.watsup:163.1-164.76 - def {ct : comptype, fin : fin, ht* : heaptype*, xx* : typevar*, y* : idx*} subst_subtype(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:165.1-166.73 def {ct : comptype, fin : fin, ht* : heaptype*, ht'* : heaptype*, xx* : typevar*} subst_subtype(SUBD_subtype(fin, ht'*{ht'}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx}, ht*{ht})*{ht'}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:163.1-164.76 + def {ct : comptype, fin : fin, ht* : heaptype*, xx* : typevar*, y* : idx*} subst_subtype(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:123.1-123.92 def subst_rectype : (rectype, typevar*, heaptype*) -> rectype @@ -826,14 +969,14 @@ def subst_memtype : (memtype, typevar*, heaptype*) -> memtype ;; 2-syntax-aux.watsup:131.1-131.92 def subst_externtype : (externtype, typevar*, heaptype*) -> externtype - ;; 2-syntax-aux.watsup:177.1-177.79 - def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_externtype(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:178.1-178.86 - def {gt : globaltype, ht* : heaptype*, xx* : typevar*} subst_externtype(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:179.1-179.83 - def {ht* : heaptype*, tt : tabletype, xx* : typevar*} subst_externtype(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:180.1-180.77 def {ht* : heaptype*, mt : memtype, xx* : typevar*} subst_externtype(MEM_externtype(mt), xx*{xx}, ht*{ht}) = MEM_externtype($subst_memtype(mt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:179.1-179.83 + def {ht* : heaptype*, tt : tabletype, xx* : typevar*} subst_externtype(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:178.1-178.86 + def {gt : globaltype, ht* : heaptype*, xx* : typevar*} subst_externtype(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:177.1-177.79 + def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_externtype(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:183.1-183.74 def subst_all_reftype : (reftype, heaptype*) -> reftype @@ -850,10 +993,10 @@ rec { ;; 2-syntax-aux.watsup:189.1-189.77 def subst_all_deftypes : (deftype*, heaptype*) -> deftype* - ;; 2-syntax-aux.watsup:191.1-191.40 - def {ht* : heaptype*} subst_all_deftypes([], ht*{ht}) = [] ;; 2-syntax-aux.watsup:192.1-192.101 def {dt* : deftype*, dt_1 : deftype, ht* : heaptype*} subst_all_deftypes([dt_1] :: dt*{dt}, ht*{ht}) = [$subst_all_deftype(dt_1, ht*{ht})] :: $subst_all_deftypes(dt*{dt}, ht*{ht}) + ;; 2-syntax-aux.watsup:191.1-191.40 + def {ht* : heaptype*} subst_all_deftypes([], ht*{ht}) = [] } ;; 2-syntax-aux.watsup:197.1-197.65 @@ -897,13 +1040,13 @@ rec { ;; 2-syntax-aux.watsup:221.1-221.64 def funcsxt : externtype* -> deftype* - ;; 2-syntax-aux.watsup:226.1-226.24 - def funcsxt([]) = [] - ;; 2-syntax-aux.watsup:227.1-227.47 - def {dt : deftype, et* : externtype*} funcsxt([FUNC_externtype(dt)] :: et*{et}) = [dt] :: $funcsxt(et*{et}) ;; 2-syntax-aux.watsup:228.1-228.59 def {et* : externtype*, externtype : externtype} funcsxt([externtype] :: et*{et}) = $funcsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:227.1-227.47 + def {dt : deftype, et* : externtype*} funcsxt([FUNC_externtype(dt)] :: et*{et}) = [dt] :: $funcsxt(et*{et}) + ;; 2-syntax-aux.watsup:226.1-226.24 + def funcsxt([]) = [] } ;; 2-syntax-aux.watsup:222.1-222.66 @@ -911,13 +1054,13 @@ rec { ;; 2-syntax-aux.watsup:222.1-222.66 def globalsxt : externtype* -> globaltype* - ;; 2-syntax-aux.watsup:230.1-230.26 - def globalsxt([]) = [] - ;; 2-syntax-aux.watsup:231.1-231.53 - def {et* : externtype*, gt : globaltype} globalsxt([GLOBAL_externtype(gt)] :: et*{et}) = [gt] :: $globalsxt(et*{et}) ;; 2-syntax-aux.watsup:232.1-232.63 def {et* : externtype*, externtype : externtype} globalsxt([externtype] :: et*{et}) = $globalsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:231.1-231.53 + def {et* : externtype*, gt : globaltype} globalsxt([GLOBAL_externtype(gt)] :: et*{et}) = [gt] :: $globalsxt(et*{et}) + ;; 2-syntax-aux.watsup:230.1-230.26 + def globalsxt([]) = [] } ;; 2-syntax-aux.watsup:223.1-223.65 @@ -925,13 +1068,13 @@ rec { ;; 2-syntax-aux.watsup:223.1-223.65 def tablesxt : externtype* -> tabletype* - ;; 2-syntax-aux.watsup:234.1-234.25 - def tablesxt([]) = [] - ;; 2-syntax-aux.watsup:235.1-235.50 - def {et* : externtype*, tt : tabletype} tablesxt([TABLE_externtype(tt)] :: et*{et}) = [tt] :: $tablesxt(et*{et}) ;; 2-syntax-aux.watsup:236.1-236.61 def {et* : externtype*, externtype : externtype} tablesxt([externtype] :: et*{et}) = $tablesxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:235.1-235.50 + def {et* : externtype*, tt : tabletype} tablesxt([TABLE_externtype(tt)] :: et*{et}) = [tt] :: $tablesxt(et*{et}) + ;; 2-syntax-aux.watsup:234.1-234.25 + def tablesxt([]) = [] } ;; 2-syntax-aux.watsup:224.1-224.63 @@ -939,13 +1082,13 @@ rec { ;; 2-syntax-aux.watsup:224.1-224.63 def memsxt : externtype* -> memtype* - ;; 2-syntax-aux.watsup:238.1-238.23 - def memsxt([]) = [] - ;; 2-syntax-aux.watsup:239.1-239.44 - def {et* : externtype*, mt : memtype} memsxt([MEM_externtype(mt)] :: et*{et}) = [mt] :: $memsxt(et*{et}) ;; 2-syntax-aux.watsup:240.1-240.57 def {et* : externtype*, externtype : externtype} memsxt([externtype] :: et*{et}) = $memsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:239.1-239.44 + def {et* : externtype*, mt : memtype} memsxt([MEM_externtype(mt)] :: et*{et}) = [mt] :: $memsxt(et*{et}) + ;; 2-syntax-aux.watsup:238.1-238.23 + def memsxt([]) = [] } ;; 2-syntax-aux.watsup:249.1-249.33 @@ -958,12 +1101,12 @@ def s33_to_u32 : s33 -> u32 ;; 3-numerics.watsup:12.1-12.57 def signed : (N, nat) -> int - ;; 3-numerics.watsup:13.1-13.54 - def {N : N, i : nat} signed(N, i) = (i <: int) - -- if (0 <= (2 ^ (N - 1))) ;; 3-numerics.watsup:14.1-14.60 def {N : N, i : nat} signed(N, i) = ((i - (2 ^ N)) <: int) -- if (((2 ^ (N - 1)) <= i) /\ (i < (2 ^ N))) + ;; 3-numerics.watsup:13.1-13.54 + def {N : N, i : nat} signed(N, i) = (i <: int) + -- if (0 <= (2 ^ (N - 1))) ;; 3-numerics.watsup:16.1-16.63 def invsigned : (N, int) -> nat @@ -1267,45 +1410,45 @@ def inst_reftype : (moduleinst, reftype) -> reftype ;; 5-runtime-aux.watsup:19.1-19.52 def default : valtype -> val? - ;; 5-runtime-aux.watsup:21.1-21.34 - def default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) - ;; 5-runtime-aux.watsup:22.1-22.34 - def default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) - ;; 5-runtime-aux.watsup:23.1-23.34 - def default(F32_valtype) = ?(CONST_val(F32_numtype, 0)) - ;; 5-runtime-aux.watsup:24.1-24.34 - def default(F64_valtype) = ?(CONST_val(F64_numtype, 0)) - ;; 5-runtime-aux.watsup:25.1-25.42 - def {ht : heaptype} default(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) ;; 5-runtime-aux.watsup:26.1-26.31 def {ht : heaptype} default(REF_valtype(`NULL%?`(?()), ht)) = ?() + ;; 5-runtime-aux.watsup:25.1-25.42 + def {ht : heaptype} default(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) + ;; 5-runtime-aux.watsup:24.1-24.34 + def default(F64_valtype) = ?(CONST_val(F64_numtype, 0)) + ;; 5-runtime-aux.watsup:23.1-23.34 + def default(F32_valtype) = ?(CONST_val(F32_numtype, 0)) + ;; 5-runtime-aux.watsup:22.1-22.34 + def default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) + ;; 5-runtime-aux.watsup:21.1-21.34 + def default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) ;; 5-runtime-aux.watsup:31.1-31.73 def packval : (storagetype, val) -> fieldval - ;; 5-runtime-aux.watsup:34.1-34.27 - def {t : valtype, val : val} packval((t <: storagetype), val) = (val <: fieldval) ;; 5-runtime-aux.watsup:35.1-35.70 def {i : nat, pt : packedtype} packval((pt <: storagetype), CONST_val(I32_numtype, i)) = PACK_fieldval(pt, $wrap(32, $packedsize(pt), i)) + ;; 5-runtime-aux.watsup:34.1-34.27 + def {t : valtype, val : val} packval((t <: storagetype), val) = (val <: fieldval) ;; 5-runtime-aux.watsup:32.1-32.83 def unpackval : (storagetype, sx?, fieldval) -> val - ;; 5-runtime-aux.watsup:37.1-37.34 - def {t : valtype, val : val} unpackval((t <: storagetype), ?(), (val <: fieldval)) = val ;; 5-runtime-aux.watsup:38.1-38.79 def {i : nat, pt : packedtype, sx : sx} unpackval((pt <: storagetype), ?(sx), PACK_fieldval(pt, i)) = CONST_val(I32_numtype, $ext($packedsize(pt), 32, sx, i)) + ;; 5-runtime-aux.watsup:37.1-37.34 + def {t : valtype, val : val} unpackval((t <: storagetype), ?(), (val <: fieldval)) = val ;; 5-runtime-aux.watsup:43.1-43.62 rec { ;; 5-runtime-aux.watsup:43.1-43.62 def funcsxv : externval* -> funcaddr* - ;; 5-runtime-aux.watsup:48.1-48.24 - def funcsxv([]) = [] - ;; 5-runtime-aux.watsup:49.1-49.47 - def {fa : funcaddr, xv* : externval*} funcsxv([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) ;; 5-runtime-aux.watsup:50.1-50.58 def {externval : externval, xv* : externval*} funcsxv([externval] :: xv*{xv}) = $funcsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:49.1-49.47 + def {fa : funcaddr, xv* : externval*} funcsxv([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:48.1-48.24 + def funcsxv([]) = [] } ;; 5-runtime-aux.watsup:44.1-44.64 @@ -1313,13 +1456,13 @@ rec { ;; 5-runtime-aux.watsup:44.1-44.64 def globalsxv : externval* -> globaladdr* - ;; 5-runtime-aux.watsup:52.1-52.26 - def globalsxv([]) = [] - ;; 5-runtime-aux.watsup:53.1-53.53 - def {ga : globaladdr, xv* : externval*} globalsxv([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) ;; 5-runtime-aux.watsup:54.1-54.62 def {externval : externval, xv* : externval*} globalsxv([externval] :: xv*{xv}) = $globalsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:53.1-53.53 + def {ga : globaladdr, xv* : externval*} globalsxv([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:52.1-52.26 + def globalsxv([]) = [] } ;; 5-runtime-aux.watsup:45.1-45.63 @@ -1327,13 +1470,13 @@ rec { ;; 5-runtime-aux.watsup:45.1-45.63 def tablesxv : externval* -> tableaddr* - ;; 5-runtime-aux.watsup:56.1-56.25 - def tablesxv([]) = [] - ;; 5-runtime-aux.watsup:57.1-57.50 - def {ta : tableaddr, xv* : externval*} tablesxv([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) ;; 5-runtime-aux.watsup:58.1-58.60 def {externval : externval, xv* : externval*} tablesxv([externval] :: xv*{xv}) = $tablesxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:57.1-57.50 + def {ta : tableaddr, xv* : externval*} tablesxv([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) + ;; 5-runtime-aux.watsup:56.1-56.25 + def tablesxv([]) = [] } ;; 5-runtime-aux.watsup:46.1-46.61 @@ -1341,13 +1484,13 @@ rec { ;; 5-runtime-aux.watsup:46.1-46.61 def memsxv : externval* -> memaddr* - ;; 5-runtime-aux.watsup:60.1-60.23 - def memsxv([]) = [] - ;; 5-runtime-aux.watsup:61.1-61.44 - def {ma : memaddr, xv* : externval*} memsxv([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) ;; 5-runtime-aux.watsup:62.1-62.56 def {externval : externval, xv* : externval*} memsxv([externval] :: xv*{xv}) = $memsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:61.1-61.44 + def {ma : memaddr, xv* : externval*} memsxv([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:60.1-60.23 + def memsxv([]) = [] } ;; 5-runtime-aux.watsup:72.1-72.57 @@ -1547,10 +1690,10 @@ rec { ;; 6-typing.watsup:26.1-26.86 def with_locals : (context, localidx*, localtype*) -> context - ;; 6-typing.watsup:28.1-28.34 - def {C : context} with_locals(C, [], []) = C ;; 6-typing.watsup:29.1-29.85 def {C : context, lt* : localtype*, lt_1 : localtype, x* : idx*, x_1 : idx} with_locals(C, [x_1] :: x*{x}, [lt_1] :: lt*{lt}) = $with_locals(C[LOCAL_context[x_1] = lt_1], x*{x}, lt*{lt}) + ;; 6-typing.watsup:28.1-28.34 + def {C : context} with_locals(C, [], []) = C } ;; 6-typing.watsup:33.1-33.65 @@ -1558,11 +1701,11 @@ rec { ;; 6-typing.watsup:33.1-33.65 def clostypes : deftype* -> deftype* - ;; 6-typing.watsup:37.1-37.26 - def clostypes([]) = [] ;; 6-typing.watsup:38.1-38.93 def {dt* : deftype*, dt'* : deftype*, dt_N : deftype} clostypes(dt*{dt} :: [dt_N]) = dt'*{dt'} :: [$subst_all_deftype(dt_N, (dt' <: heaptype)*{dt'})] -- if (dt'*{dt'} = $clostypes(dt*{dt})) + ;; 6-typing.watsup:37.1-37.26 + def clostypes([]) = [] } ;; 6-typing.watsup:32.1-32.65 @@ -1585,19 +1728,19 @@ relation Vectype_ok: `%|-%:OK`(context, vectype) ;; 6-typing.watsup:49.1-49.72 relation Heaptype_ok: `%|-%:OK`(context, heaptype) - ;; 6-typing.watsup:60.1-61.24 - rule abs {C : context, absheaptype : absheaptype}: - `%|-%:OK`(C, (absheaptype <: heaptype)) + ;; 6-typing.watsup:67.1-69.22 + rule rec {C : context, i : nat, st : subtype}: + `%|-%:OK`(C, REC_heaptype(i)) + -- if (C.REC_context[i] = st) ;; 6-typing.watsup:63.1-65.23 rule typeidx {C : context, dt : deftype, x : idx}: `%|-%:OK`(C, _IDX_heaptype(x)) -- if (C.TYPE_context[x] = dt) - ;; 6-typing.watsup:67.1-69.22 - rule rec {C : context, i : nat, st : subtype}: - `%|-%:OK`(C, REC_heaptype(i)) - -- if (C.REC_context[i] = st) + ;; 6-typing.watsup:60.1-61.24 + rule abs {C : context, absheaptype : absheaptype}: + `%|-%:OK`(C, (absheaptype <: heaptype)) ;; 6-typing.watsup:50.1-50.71 relation Reftype_ok: `%|-%:OK`(context, reftype) @@ -1608,24 +1751,24 @@ relation Reftype_ok: `%|-%:OK`(context, reftype) ;; 6-typing.watsup:51.1-51.71 relation Valtype_ok: `%|-%:OK`(context, valtype) - ;; 6-typing.watsup:75.1-77.35 - rule num {C : context, numtype : numtype}: - `%|-%:OK`(C, (numtype <: valtype)) - -- Numtype_ok: `%|-%:OK`(C, numtype) - - ;; 6-typing.watsup:79.1-81.35 - rule vec {C : context, vectype : vectype}: - `%|-%:OK`(C, (vectype <: valtype)) - -- Vectype_ok: `%|-%:OK`(C, vectype) + ;; 6-typing.watsup:87.1-88.16 + rule bot {C : context}: + `%|-%:OK`(C, BOT_valtype) ;; 6-typing.watsup:83.1-85.35 rule ref {C : context, reftype : reftype}: `%|-%:OK`(C, (reftype <: valtype)) -- Reftype_ok: `%|-%:OK`(C, reftype) - ;; 6-typing.watsup:87.1-88.16 - rule bot {C : context}: - `%|-%:OK`(C, BOT_valtype) + ;; 6-typing.watsup:79.1-81.35 + rule vec {C : context, vectype : vectype}: + `%|-%:OK`(C, (vectype <: valtype)) + -- Vectype_ok: `%|-%:OK`(C, vectype) + + ;; 6-typing.watsup:75.1-77.35 + rule num {C : context, numtype : numtype}: + `%|-%:OK`(C, (numtype <: valtype)) + -- Numtype_ok: `%|-%:OK`(C, numtype) ;; 6-typing.watsup:93.1-93.74 relation Resulttype_ok: `%|-%:OK`(context, resulttype) @@ -1659,16 +1802,16 @@ relation Packedtype_ok: `%|-%:OK`(context, packedtype) ;; 6-typing.watsup:114.1-114.77 relation Storagetype_ok: `%|-%:OK`(context, storagetype) - ;; 6-typing.watsup:131.1-133.35 - rule val {C : context, valtype : valtype}: - `%|-%:OK`(C, (valtype <: storagetype)) - -- Valtype_ok: `%|-%:OK`(C, valtype) - ;; 6-typing.watsup:135.1-137.41 rule packed {C : context, packedtype : packedtype}: `%|-%:OK`(C, (packedtype <: storagetype)) -- Packedtype_ok: `%|-%:OK`(C, packedtype) + ;; 6-typing.watsup:131.1-133.35 + rule val {C : context, valtype : valtype}: + `%|-%:OK`(C, (valtype <: storagetype)) + -- Valtype_ok: `%|-%:OK`(C, valtype) + ;; 6-typing.watsup:113.1-113.75 relation Fieldtype_ok: `%|-%:OK`(context, fieldtype) ;; 6-typing.watsup:139.1-141.34 @@ -1686,20 +1829,20 @@ relation Functype_ok: `%|-%:OK`(context, functype) ;; 6-typing.watsup:115.1-115.74 relation Comptype_ok: `%|-%:OK`(context, comptype) - ;; 6-typing.watsup:144.1-146.35 - rule struct {C : context, yt* : fieldtype*}: - `%|-%:OK`(C, STRUCT_comptype(yt*{yt})) - -- (Fieldtype_ok: `%|-%:OK`(C, yt))*{yt} + ;; 6-typing.watsup:152.1-154.31 + rule func {C : context, ft : functype}: + `%|-%:OK`(C, FUNC_comptype(ft)) + -- Functype_ok: `%|-%:OK`(C, ft) ;; 6-typing.watsup:148.1-150.32 rule array {C : context, yt : fieldtype}: `%|-%:OK`(C, ARRAY_comptype(yt)) -- Fieldtype_ok: `%|-%:OK`(C, yt) - ;; 6-typing.watsup:152.1-154.31 - rule func {C : context, ft : functype}: - `%|-%:OK`(C, FUNC_comptype(ft)) - -- Functype_ok: `%|-%:OK`(C, ft) + ;; 6-typing.watsup:144.1-146.35 + rule struct {C : context, yt* : fieldtype*}: + `%|-%:OK`(C, STRUCT_comptype(yt*{yt})) + -- (Fieldtype_ok: `%|-%:OK`(C, yt))*{yt} ;; 6-typing.watsup:391.1-391.91 relation Packedtype_sub: `%|-%<:%`(context, packedtype, packedtype) @@ -1718,113 +1861,113 @@ rec { ;; 6-typing.watsup:125.1-125.75 relation Deftype_sub: `%|-%<:%`(context, deftype, deftype) - ;; 6-typing.watsup:434.1-436.58 - rule refl {C : context, deftype_1 : deftype, deftype_2 : deftype}: - `%|-%<:%`(C, deftype_1, deftype_2) - -- if ($clostype(C, deftype_1) = $clostype(C, deftype_2)) - ;; 6-typing.watsup:438.1-441.40 rule super {C : context, ct : comptype, deftype_1 : deftype, deftype_2 : deftype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*}: `%|-%<:%`(C, deftype_1, deftype_2) -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) -- Heaptype_sub: `%|-%<:%`(C, ht, (deftype_2 <: heaptype)) + ;; 6-typing.watsup:434.1-436.58 + rule refl {C : context, deftype_1 : deftype, deftype_2 : deftype}: + `%|-%<:%`(C, deftype_1, deftype_2) + -- if ($clostype(C, deftype_1) = $clostype(C, deftype_2)) + ;; 6-typing.watsup:271.1-271.79 relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) - ;; 6-typing.watsup:282.1-283.28 - rule refl {C : context, heaptype : heaptype}: - `%|-%<:%`(C, heaptype, heaptype) + ;; 6-typing.watsup:343.1-344.23 + rule bot {C : context, heaptype : heaptype}: + `%|-%<:%`(C, BOT_heaptype, heaptype) - ;; 6-typing.watsup:285.1-289.48 - rule trans {C : context, heaptype' : heaptype, heaptype_1 : heaptype, heaptype_2 : heaptype}: - `%|-%<:%`(C, heaptype_1, heaptype_2) - -- Heaptype_ok: `%|-%:OK`(C, heaptype') - -- Heaptype_sub: `%|-%<:%`(C, heaptype_1, heaptype') - -- Heaptype_sub: `%|-%<:%`(C, heaptype', heaptype_2) + ;; 6-typing.watsup:339.1-341.43 + rule noextern {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NOEXTERN_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, EXTERN_heaptype) - ;; 6-typing.watsup:291.1-292.17 - rule eq-any {C : context}: - `%|-%<:%`(C, EQ_heaptype, ANY_heaptype) + ;; 6-typing.watsup:335.1-337.41 + rule nofunc {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NOFUNC_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, FUNC_heaptype) - ;; 6-typing.watsup:294.1-295.17 - rule i31-eq {C : context}: - `%|-%<:%`(C, I31_heaptype, EQ_heaptype) + ;; 6-typing.watsup:331.1-333.40 + rule none {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NONE_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, ANY_heaptype) - ;; 6-typing.watsup:297.1-298.20 - rule struct-eq {C : context}: - `%|-%<:%`(C, STRUCT_heaptype, EQ_heaptype) + ;; 6-typing.watsup:327.1-329.48 + rule rec {C : context, ct : comptype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*, i : nat}: + `%|-%<:%`(C, REC_heaptype(i), ht) + -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) - ;; 6-typing.watsup:300.1-301.19 - rule array-eq {C : context}: - `%|-%<:%`(C, ARRAY_heaptype, EQ_heaptype) + ;; 6-typing.watsup:323.1-325.52 + rule typeidx-r {C : context, heaptype : heaptype, typeidx : typeidx}: + `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[typeidx] <: heaptype)) - ;; 6-typing.watsup:303.1-305.35 - rule struct {C : context, deftype : deftype, yt* : fieldtype*}: - `%|-%<:%`(C, (deftype <: heaptype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) + ;; 6-typing.watsup:319.1-321.52 + rule typeidx-l {C : context, heaptype : heaptype, typeidx : typeidx}: + `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) + -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[typeidx] <: heaptype), heaptype) - ;; 6-typing.watsup:307.1-309.33 - rule array {C : context, deftype : deftype, yt : fieldtype}: - `%|-%<:%`(C, (deftype <: heaptype), ARRAY_heaptype) - -- Expand: `%~~%`(deftype, ARRAY_comptype(yt)) + ;; 6-typing.watsup:315.1-317.46 + rule def {C : context, deftype_1 : deftype, deftype_2 : deftype}: + `%|-%<:%`(C, (deftype_1 <: heaptype), (deftype_2 <: heaptype)) + -- Deftype_sub: `%|-%<:%`(C, deftype_1, deftype_2) ;; 6-typing.watsup:311.1-313.32 rule func {C : context, deftype : deftype, ft : functype}: `%|-%<:%`(C, (deftype <: heaptype), FUNC_heaptype) -- Expand: `%~~%`(deftype, FUNC_comptype(ft)) - ;; 6-typing.watsup:315.1-317.46 - rule def {C : context, deftype_1 : deftype, deftype_2 : deftype}: - `%|-%<:%`(C, (deftype_1 <: heaptype), (deftype_2 <: heaptype)) - -- Deftype_sub: `%|-%<:%`(C, deftype_1, deftype_2) + ;; 6-typing.watsup:307.1-309.33 + rule array {C : context, deftype : deftype, yt : fieldtype}: + `%|-%<:%`(C, (deftype <: heaptype), ARRAY_heaptype) + -- Expand: `%~~%`(deftype, ARRAY_comptype(yt)) - ;; 6-typing.watsup:319.1-321.52 - rule typeidx-l {C : context, heaptype : heaptype, typeidx : typeidx}: - `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) - -- Heaptype_sub: `%|-%<:%`(C, (C.TYPE_context[typeidx] <: heaptype), heaptype) + ;; 6-typing.watsup:303.1-305.35 + rule struct {C : context, deftype : deftype, yt* : fieldtype*}: + `%|-%<:%`(C, (deftype <: heaptype), STRUCT_heaptype) + -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) - ;; 6-typing.watsup:323.1-325.52 - rule typeidx-r {C : context, heaptype : heaptype, typeidx : typeidx}: - `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, (C.TYPE_context[typeidx] <: heaptype)) + ;; 6-typing.watsup:300.1-301.19 + rule array-eq {C : context}: + `%|-%<:%`(C, ARRAY_heaptype, EQ_heaptype) - ;; 6-typing.watsup:327.1-329.48 - rule rec {C : context, ct : comptype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*, i : nat}: - `%|-%<:%`(C, REC_heaptype(i), ht) - -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + ;; 6-typing.watsup:297.1-298.20 + rule struct-eq {C : context}: + `%|-%<:%`(C, STRUCT_heaptype, EQ_heaptype) - ;; 6-typing.watsup:331.1-333.40 - rule none {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NONE_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, ANY_heaptype) + ;; 6-typing.watsup:294.1-295.17 + rule i31-eq {C : context}: + `%|-%<:%`(C, I31_heaptype, EQ_heaptype) - ;; 6-typing.watsup:335.1-337.41 - rule nofunc {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NOFUNC_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, FUNC_heaptype) + ;; 6-typing.watsup:291.1-292.17 + rule eq-any {C : context}: + `%|-%<:%`(C, EQ_heaptype, ANY_heaptype) - ;; 6-typing.watsup:339.1-341.43 - rule noextern {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NOEXTERN_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, EXTERN_heaptype) + ;; 6-typing.watsup:285.1-289.48 + rule trans {C : context, heaptype' : heaptype, heaptype_1 : heaptype, heaptype_2 : heaptype}: + `%|-%<:%`(C, heaptype_1, heaptype_2) + -- Heaptype_ok: `%|-%:OK`(C, heaptype') + -- Heaptype_sub: `%|-%<:%`(C, heaptype_1, heaptype') + -- Heaptype_sub: `%|-%<:%`(C, heaptype', heaptype_2) - ;; 6-typing.watsup:343.1-344.23 - rule bot {C : context, heaptype : heaptype}: - `%|-%<:%`(C, BOT_heaptype, heaptype) + ;; 6-typing.watsup:282.1-283.28 + rule refl {C : context, heaptype : heaptype}: + `%|-%<:%`(C, heaptype, heaptype) } ;; 6-typing.watsup:272.1-272.78 relation Reftype_sub: `%|-%<:%`(context, reftype, reftype) - ;; 6-typing.watsup:347.1-349.37 - rule nonnull {C : context, ht_1 : heaptype, ht_2 : heaptype}: - `%|-%<:%`(C, REF_reftype(`NULL%?`(?()), ht_1), REF_reftype(`NULL%?`(?()), ht_2)) - -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) - ;; 6-typing.watsup:351.1-353.37 rule null {C : context, ht_1 : heaptype, ht_2 : heaptype}: `%|-%<:%`(C, REF_reftype(`NULL%?`(()?{}), ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) + ;; 6-typing.watsup:347.1-349.37 + rule nonnull {C : context, ht_1 : heaptype, ht_2 : heaptype}: + `%|-%<:%`(C, REF_reftype(`NULL%?`(?()), ht_1), REF_reftype(`NULL%?`(?()), ht_2)) + -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) + ;; 6-typing.watsup:270.1-270.78 relation Vectype_sub: `%|-%<:%`(context, vectype, vectype) ;; 6-typing.watsup:278.1-279.26 @@ -1833,50 +1976,50 @@ relation Vectype_sub: `%|-%<:%`(context, vectype, vectype) ;; 6-typing.watsup:273.1-273.78 relation Valtype_sub: `%|-%<:%`(context, valtype, valtype) - ;; 6-typing.watsup:356.1-358.46 - rule num {C : context, numtype_1 : numtype, numtype_2 : numtype}: - `%|-%<:%`(C, (numtype_1 <: valtype), (numtype_2 <: valtype)) - -- Numtype_sub: `%|-%<:%`(C, numtype_1, numtype_2) - - ;; 6-typing.watsup:360.1-362.46 - rule vec {C : context, vectype_1 : vectype, vectype_2 : vectype}: - `%|-%<:%`(C, (vectype_1 <: valtype), (vectype_2 <: valtype)) - -- Vectype_sub: `%|-%<:%`(C, vectype_1, vectype_2) + ;; 6-typing.watsup:368.1-369.22 + rule bot {C : context, valtype : valtype}: + `%|-%<:%`(C, BOT_valtype, valtype) ;; 6-typing.watsup:364.1-366.46 rule ref {C : context, reftype_1 : reftype, reftype_2 : reftype}: `%|-%<:%`(C, (reftype_1 <: valtype), (reftype_2 <: valtype)) -- Reftype_sub: `%|-%<:%`(C, reftype_1, reftype_2) - ;; 6-typing.watsup:368.1-369.22 - rule bot {C : context, valtype : valtype}: - `%|-%<:%`(C, BOT_valtype, valtype) + ;; 6-typing.watsup:360.1-362.46 + rule vec {C : context, vectype_1 : vectype, vectype_2 : vectype}: + `%|-%<:%`(C, (vectype_1 <: valtype), (vectype_2 <: valtype)) + -- Vectype_sub: `%|-%<:%`(C, vectype_1, vectype_2) + + ;; 6-typing.watsup:356.1-358.46 + rule num {C : context, numtype_1 : numtype, numtype_2 : numtype}: + `%|-%<:%`(C, (numtype_1 <: valtype), (numtype_2 <: valtype)) + -- Numtype_sub: `%|-%<:%`(C, numtype_1, numtype_2) ;; 6-typing.watsup:392.1-392.92 relation Storagetype_sub: `%|-%<:%`(context, storagetype, storagetype) - ;; 6-typing.watsup:402.1-404.46 - rule val {C : context, valtype_1 : valtype, valtype_2 : valtype}: - `%|-%<:%`(C, (valtype_1 <: storagetype), (valtype_2 <: storagetype)) - -- Valtype_sub: `%|-%<:%`(C, valtype_1, valtype_2) - ;; 6-typing.watsup:406.1-408.55 rule packed {C : context, packedtype_1 : packedtype, packedtype_2 : packedtype}: `%|-%<:%`(C, (packedtype_1 <: storagetype), (packedtype_2 <: storagetype)) -- Packedtype_sub: `%|-%<:%`(C, packedtype_1, packedtype_2) + ;; 6-typing.watsup:402.1-404.46 + rule val {C : context, valtype_1 : valtype, valtype_2 : valtype}: + `%|-%<:%`(C, (valtype_1 <: storagetype), (valtype_2 <: storagetype)) + -- Valtype_sub: `%|-%<:%`(C, valtype_1, valtype_2) + ;; 6-typing.watsup:393.1-393.90 relation Fieldtype_sub: `%|-%<:%`(context, fieldtype, fieldtype) - ;; 6-typing.watsup:411.1-413.40 - rule const {C : context, zt_1 : storagetype, zt_2 : storagetype}: - `%|-%<:%`(C, `%%`(`MUT%?`(?()), zt_1), `%%`(`MUT%?`(?()), zt_2)) - -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) - ;; 6-typing.watsup:415.1-418.40 rule var {C : context, zt_1 : storagetype, zt_2 : storagetype}: `%|-%<:%`(C, `%%`(`MUT%?`(?(())), zt_1), `%%`(`MUT%?`(?(())), zt_2)) -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) + ;; 6-typing.watsup:411.1-413.40 + rule const {C : context, zt_1 : storagetype, zt_2 : storagetype}: + `%|-%<:%`(C, `%%`(`MUT%?`(?()), zt_1), `%%`(`MUT%?`(?()), zt_2)) + -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) + ;; 6-typing.watsup:395.1-395.89 relation Functype_sub: `%|-%<:%`(context, functype, functype) ;; 6-typing.watsup:458.1-459.16 @@ -1885,20 +2028,20 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) ;; 6-typing.watsup:124.1-124.76 relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) - ;; 6-typing.watsup:421.1-423.41 - rule struct {C : context, yt'_1 : fieldtype, yt_1* : fieldtype*, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) - -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} + ;; 6-typing.watsup:429.1-431.37 + rule func {C : context, ft_1 : functype, ft_2 : functype}: + `%|-%<:%`(C, FUNC_comptype(ft_1), FUNC_comptype(ft_2)) + -- Functype_sub: `%|-%<:%`(C, ft_1, ft_2) ;; 6-typing.watsup:425.1-427.38 rule array {C : context, yt_1 : fieldtype, yt_2 : fieldtype}: `%|-%<:%`(C, ARRAY_comptype(yt_1), ARRAY_comptype(yt_2)) -- Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2) - ;; 6-typing.watsup:429.1-431.37 - rule func {C : context, ft_1 : functype, ft_2 : functype}: - `%|-%<:%`(C, FUNC_comptype(ft_1), FUNC_comptype(ft_2)) - -- Functype_sub: `%|-%<:%`(C, ft_1, ft_2) + ;; 6-typing.watsup:421.1-423.41 + rule struct {C : context, yt'_1 : fieldtype, yt_1* : fieldtype*, yt_2* : fieldtype*}: + `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) + -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} ;; 6-typing.watsup:117.1-117.73 relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) @@ -1913,21 +2056,21 @@ relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) ;; 6-typing.watsup:165.1-165.65 def before : (heaptype, typeidx, nat) -> bool - ;; 6-typing.watsup:166.1-166.34 - def {deftype : deftype, i : nat, x : idx} before((deftype <: heaptype), x, i) = true - ;; 6-typing.watsup:167.1-167.46 - def {i : nat, typeidx : typeidx, x : idx} before(_IDX_heaptype(typeidx), x, i) = (typeidx < x) ;; 6-typing.watsup:168.1-168.33 def {i : nat, j : nat, x : idx} before(REC_heaptype(j), x, i) = (j < i) + ;; 6-typing.watsup:167.1-167.46 + def {i : nat, typeidx : typeidx, x : idx} before(_IDX_heaptype(typeidx), x, i) = (typeidx < x) + ;; 6-typing.watsup:166.1-166.34 + def {deftype : deftype, i : nat, x : idx} before((deftype <: heaptype), x, i) = true ;; 6-typing.watsup:170.1-170.69 def unrollht : (context, heaptype) -> subtype - ;; 6-typing.watsup:171.1-171.47 - def {C : context, deftype : deftype} unrollht(C, (deftype <: heaptype)) = $unrolldt(deftype) - ;; 6-typing.watsup:172.1-172.60 - def {C : context, typeidx : typeidx} unrollht(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx]) ;; 6-typing.watsup:173.1-173.35 def {C : context, i : nat} unrollht(C, REC_heaptype(i)) = C.REC_context[i] + ;; 6-typing.watsup:172.1-172.60 + def {C : context, typeidx : typeidx} unrollht(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx]) + ;; 6-typing.watsup:171.1-171.47 + def {C : context, deftype : deftype} unrollht(C, (deftype <: heaptype)) = $unrolldt(deftype) ;; 6-typing.watsup:119.1-119.76 relation Subtype_ok2: `%|-%:%`(context, subtype, oktypeidxnat) @@ -1945,15 +2088,15 @@ rec { ;; 6-typing.watsup:120.1-120.76 relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) - ;; 6-typing.watsup:196.1-197.24 - rule empty {C : context, i : nat, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) - ;; 6-typing.watsup:199.1-202.50 rule cons {C : context, i : nat, st* : subtype*, st_1 : subtype, x : idx}: `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidxnat((x + 1), (i + 1))) + + ;; 6-typing.watsup:196.1-197.24 + rule empty {C : context, i : nat, x : idx}: + `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) } ;; 6-typing.watsup:118.1-118.74 @@ -1961,9 +2104,10 @@ rec { ;; 6-typing.watsup:118.1-118.74 relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) - ;; 6-typing.watsup:184.1-185.23 - rule empty {C : context, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) + ;; 6-typing.watsup:192.1-194.49 + rule rec2 {C : context, st* : subtype*, x : idx}: + `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) ;; 6-typing.watsup:187.1-190.43 rule cons {C : context, st* : subtype*, st_1 : subtype, x : idx}: @@ -1971,10 +2115,9 @@ relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x + 1)) - ;; 6-typing.watsup:192.1-194.49 - rule rec2 {C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) + ;; 6-typing.watsup:184.1-185.23 + rule empty {C : context, x : idx}: + `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) } ;; 6-typing.watsup:121.1-121.73 @@ -2017,26 +2160,26 @@ relation Memtype_ok: `%|-%:OK`(context, memtype) ;; 6-typing.watsup:218.1-218.74 relation Externtype_ok: `%|-%:OK`(context, externtype) - ;; 6-typing.watsup:244.1-247.27 - rule func {C : context, dt : deftype, ft : functype}: - `%|-%:OK`(C, FUNC_externtype(dt)) - -- Deftype_ok: `%|-%:OK`(C, dt) - -- Expand: `%~~%`(dt, FUNC_comptype(ft)) - - ;; 6-typing.watsup:249.1-251.33 - rule global {C : context, gt : globaltype}: - `%|-%:OK`(C, GLOBAL_externtype(gt)) - -- Globaltype_ok: `%|-%:OK`(C, gt) + ;; 6-typing.watsup:257.1-259.30 + rule mem {C : context, mt : memtype}: + `%|-%:OK`(C, MEM_externtype(mt)) + -- Memtype_ok: `%|-%:OK`(C, mt) ;; 6-typing.watsup:253.1-255.32 rule table {C : context, tt : tabletype}: `%|-%:OK`(C, TABLE_externtype(tt)) -- Tabletype_ok: `%|-%:OK`(C, tt) - ;; 6-typing.watsup:257.1-259.30 - rule mem {C : context, mt : memtype}: - `%|-%:OK`(C, MEM_externtype(mt)) - -- Memtype_ok: `%|-%:OK`(C, mt) + ;; 6-typing.watsup:249.1-251.33 + rule global {C : context, gt : globaltype}: + `%|-%:OK`(C, GLOBAL_externtype(gt)) + -- Globaltype_ok: `%|-%:OK`(C, gt) + + ;; 6-typing.watsup:244.1-247.27 + rule func {C : context, dt : deftype, ft : functype}: + `%|-%:OK`(C, FUNC_externtype(dt)) + -- Deftype_ok: `%|-%:OK`(C, dt) + -- Expand: `%~~%`(dt, FUNC_comptype(ft)) ;; 6-typing.watsup:374.1-374.81 relation Resulttype_sub: `%|-%*<:%*`(context, valtype*, valtype*) @@ -2065,17 +2208,17 @@ relation Limits_sub: `%|-%<:%`(context, limits, limits) ;; 6-typing.watsup:447.1-447.83 relation Globaltype_sub: `%|-%<:%`(context, globaltype, globaltype) - ;; 6-typing.watsup:461.1-463.34 - rule const {C : context, t_1 : valtype, t_2 : valtype}: - `%|-%<:%`(C, `%%`(`MUT%?`(?()), t_1), `%%`(`MUT%?`(?()), t_2)) - -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) - ;; 6-typing.watsup:465.1-468.34 rule var {C : context, t_1 : valtype, t_2 : valtype}: `%|-%<:%`(C, `%%`(`MUT%?`(?(())), t_1), `%%`(`MUT%?`(?(())), t_2)) -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) -- Valtype_sub: `%|-%<:%`(C, t_2, t_1) + ;; 6-typing.watsup:461.1-463.34 + rule const {C : context, t_1 : valtype, t_2 : valtype}: + `%|-%<:%`(C, `%%`(`MUT%?`(?()), t_1), `%%`(`MUT%?`(?()), t_2)) + -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) + ;; 6-typing.watsup:448.1-448.82 relation Tabletype_sub: `%|-%<:%`(context, tabletype, tabletype) ;; 6-typing.watsup:470.1-474.36 @@ -2094,253 +2237,258 @@ relation Memtype_sub: `%|-%<:%`(context, memtype, memtype) ;; 6-typing.watsup:450.1-450.83 relation Externtype_sub: `%|-%<:%`(context, externtype, externtype) - ;; 6-typing.watsup:481.1-483.36 - rule func {C : context, dt_1 : deftype, dt_2 : deftype}: - `%|-%<:%`(C, FUNC_externtype(dt_1), FUNC_externtype(dt_2)) - -- Deftype_sub: `%|-%<:%`(C, dt_1, dt_2) - - ;; 6-typing.watsup:485.1-487.39 - rule global {C : context, gt_1 : globaltype, gt_2 : globaltype}: - `%|-%<:%`(C, GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) - -- Globaltype_sub: `%|-%<:%`(C, gt_1, gt_2) + ;; 6-typing.watsup:493.1-495.36 + rule mem {C : context, mt_1 : memtype, mt_2 : memtype}: + `%|-%<:%`(C, MEM_externtype(mt_1), MEM_externtype(mt_2)) + -- Memtype_sub: `%|-%<:%`(C, mt_1, mt_2) ;; 6-typing.watsup:489.1-491.38 rule table {C : context, tt_1 : tabletype, tt_2 : tabletype}: `%|-%<:%`(C, TABLE_externtype(tt_1), TABLE_externtype(tt_2)) -- Tabletype_sub: `%|-%<:%`(C, tt_1, tt_2) - ;; 6-typing.watsup:493.1-495.36 - rule mem {C : context, mt_1 : memtype, mt_2 : memtype}: - `%|-%<:%`(C, MEM_externtype(mt_1), MEM_externtype(mt_2)) - -- Memtype_sub: `%|-%<:%`(C, mt_1, mt_2) + ;; 6-typing.watsup:485.1-487.39 + rule global {C : context, gt_1 : globaltype, gt_2 : globaltype}: + `%|-%<:%`(C, GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) + -- Globaltype_sub: `%|-%<:%`(C, gt_1, gt_2) + + ;; 6-typing.watsup:481.1-483.36 + rule func {C : context, dt_1 : deftype, dt_2 : deftype}: + `%|-%<:%`(C, FUNC_externtype(dt_1), FUNC_externtype(dt_2)) + -- Deftype_sub: `%|-%<:%`(C, dt_1, dt_2) ;; 6-typing.watsup:565.1-565.76 relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) - ;; 6-typing.watsup:567.1-568.32 - rule void {C : context}: - `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) + ;; 6-typing.watsup:573.1-575.34 + rule typeidx {C : context, ft : functype, x : idx}: + `%|-%:%`(C, _IDX_blocktype(x), ft) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(ft)) ;; 6-typing.watsup:570.1-571.28 rule result {C : context, t : valtype}: `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`([], [t])) - ;; 6-typing.watsup:573.1-575.34 - rule typeidx {C : context, ft : functype, x : idx}: - `%|-%:%`(C, _IDX_blocktype(x), ft) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(ft)) + ;; 6-typing.watsup:567.1-568.32 + rule void {C : context}: + `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) ;; 6-typing.watsup:503.1-505.74 rec { ;; 6-typing.watsup:503.1-503.67 relation Instr_ok: `%|-%:%`(context, instr, functype) - ;; 6-typing.watsup:544.1-545.34 - rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + ;; 6-typing.watsup:951.1-956.29 + rule store {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, x : idx}: + `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype (nt <: valtype)], [])) + -- if (C.MEM_context[x] = mt) + -- if ((2 ^ n_A) <= ($size(nt <: valtype) / 8)) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt <: valtype) / 8))))?{n} + -- if ((n?{n} = ?()) \/ (nt = (inn <: numtype))) - ;; 6-typing.watsup:547.1-548.24 - rule nop {C : context}: - `%|-%:%`(C, NOP_instr, `%->%`([], [])) + ;; 6-typing.watsup:944.1-949.29 + rule load {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, x : idx}: + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [(nt <: valtype)])) + -- if (C.MEM_context[x] = mt) + -- if ((2 ^ n_A) <= ($size(nt <: valtype) / 8)) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt <: valtype) / 8))))?{n} + -- if ((n?{n} = ?()) \/ (nt = (inn <: numtype))) - ;; 6-typing.watsup:550.1-551.23 - rule drop {C : context, t : valtype}: - `%|-%:%`(C, DROP_instr, `%->%`([t], [])) + ;; 6-typing.watsup:940.1-942.23 + rule data.drop {C : context, x : idx}: + `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) + -- if (C.DATA_context[x] = OK) - ;; 6-typing.watsup:554.1-555.31 - rule select-expl {C : context, t : valtype}: - `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) + ;; 6-typing.watsup:935.1-938.23 + rule memory.init {C : context, mt : memtype, x : idx, y : idx}: + `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x] = mt) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:557.1-560.37 - rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: - `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) - -- Valtype_sub: `%|-%<:%`(C, t, t') - -- if ((t' = (numtype <: valtype)) \/ (t' = (vectype <: valtype))) + ;; 6-typing.watsup:930.1-933.26 + rule memory.copy {C : context, mt_1 : memtype, mt_2 : memtype, x_1 : idx, x_2 : idx}: + `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x_1] = mt_1) + -- if (C.MEM_context[x_2] = mt_2) - ;; 6-typing.watsup:578.1-581.61 - rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:926.1-928.22 + rule memory.fill {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:583.1-586.61 - rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:922.1-924.22 + rule memory.grow {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:588.1-592.65 - rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: - `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) + ;; 6-typing.watsup:918.1-920.22 + rule memory.size {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:597.1-599.24 - rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.LABEL_context[l] = t*{t}) + ;; 6-typing.watsup:911.1-913.23 + rule elem.drop {C : context, rt : reftype, x : idx}: + `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) + -- if (C.ELEM_context[x] = rt) - ;; 6-typing.watsup:601.1-603.24 - rule br_if {C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) - -- if (C.LABEL_context[l] = t*{t}) + ;; 6-typing.watsup:905.1-909.36 + rule table.init {C : context, lim : limits, rt_1 : reftype, rt_2 : reftype, x : idx, y : idx}: + `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.TABLE_context[x] = `%%`(lim, rt_1)) + -- if (C.ELEM_context[y] = rt_2) + -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - ;; 6-typing.watsup:605.1-608.44 - rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- (Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l]))*{l} - -- Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l']) + ;; 6-typing.watsup:899.1-903.36 + rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt_1 : reftype, rt_2 : reftype, x_1 : idx, x_2 : idx}: + `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt_1)) + -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt_2)) + -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - ;; 6-typing.watsup:610.1-613.31 - rule br_on_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[l] = t*{t}) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:895.1-897.28 + rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype (rt <: valtype) I32_valtype], [])) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:615.1-618.31 - rule br_on_non_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) - -- if (C.LABEL_context[l] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:891.1-893.28 + rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([(rt <: valtype) I32_valtype], [I32_valtype])) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:620.1-626.34 - rule br_on_cast {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 <: valtype)], t*{t} :: [($diffrt(rt_1, rt_2) <: valtype)])) - -- if (C.LABEL_context[l] = t*{t} :: [(rt <: valtype)]) - -- Reftype_ok: `%|-%:OK`(C, rt_1) - -- Reftype_ok: `%|-%:OK`(C, rt_2) - -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) + ;; 6-typing.watsup:887.1-889.24 + rule table.size {C : context, tt : tabletype, x : idx}: + `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) + -- if (C.TABLE_context[x] = tt) - ;; 6-typing.watsup:628.1-634.49 - rule br_on_cast_fail {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 <: valtype)], t*{t} :: [(rt_2 <: valtype)])) - -- if (C.LABEL_context[l] = t*{t} :: [(rt <: valtype)]) - -- Reftype_ok: `%|-%:OK`(C, rt_1) - -- Reftype_ok: `%|-%:OK`(C, rt_2) - -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) + ;; 6-typing.watsup:883.1-885.28 + rule table.set {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype (rt <: valtype)], [])) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:639.1-641.24 - rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.RETURN_context = ?(t*{t})) + ;; 6-typing.watsup:879.1-881.28 + rule table.get {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [(rt <: valtype)])) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:643.1-645.46 - rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + ;; 6-typing.watsup:872.1-874.28 + rule global.set {C : context, t : valtype, x : idx}: + `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) + -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?(())), t)) - ;; 6-typing.watsup:647.1-649.46 - rule call_ref {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype))], t_2*{t_2})) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + ;; 6-typing.watsup:868.1-870.28 + rule global.get {C : context, mut : mut, t : valtype, x : idx}: + `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) + -- if (C.GLOBAL_context[x] = `%%`(mut, t)) - ;; 6-typing.watsup:651.1-655.46 - rule call_indirect {C : context, lim : limits, rt : reftype, t_1* : valtype*, t_2* : valtype*, x : idx, y : idx}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + ;; 6-typing.watsup:853.1-855.28 + rule local.get {C : context, init : init, t : valtype, x : idx}: + `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) + -- if (C.LOCAL_context[x] = `%%`(init, t)) - ;; 6-typing.watsup:657.1-661.40 - rule return_call {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) - -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + ;; 6-typing.watsup:847.1-848.62 + rule any.convert_extern {C : context, nul : nul}: + `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) - ;; 6-typing.watsup:663.1-667.40 - rule return_call_ref {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype))], t_4*{t_4})) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + ;; 6-typing.watsup:844.1-845.62 + rule extern.convert_any {C : context, nul : nul}: + `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) - ;; 6-typing.watsup:669.1-675.40 - rule return_call_indirect {C : context, lim : limits, rt : reftype, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx, y : idx}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + ;; 6-typing.watsup:835.1-839.23 + rule array.init_data {C : context, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- if ((t = (numtype <: valtype)) \/ (t = (vectype <: valtype))) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:680.1-681.33 - rule const {C : context, c_nt : c, nt : numtype}: - `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [(nt <: valtype)])) + ;; 6-typing.watsup:830.1-833.43 + rule array.init_elem {C : context, x : idx, y : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- Storagetype_sub: `%|-%<:%`(C, (C.ELEM_context[y] <: storagetype), zt) - ;; 6-typing.watsup:683.1-684.31 - rule unop {C : context, nt : numtype, unop : unop_numtype}: - `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([(nt <: valtype)], [(nt <: valtype)])) + ;; 6-typing.watsup:824.1-828.40 + rule array.copy {C : context, mut : mut, x_1 : idx, x_2 : idx, zt_1 : storagetype, zt_2 : storagetype}: + `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) <: heaptype)) I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x_1], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) + -- Expand: `%~~%`(C.TYPE_context[x_2], ARRAY_comptype(`%%`(mut, zt_2))) + -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) - ;; 6-typing.watsup:686.1-687.36 - rule binop {C : context, binop : binop_numtype, nt : numtype}: - `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([(nt <: valtype) (nt <: valtype)], [(nt <: valtype)])) + ;; 6-typing.watsup:820.1-822.41 + rule array.fill {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype $unpacktype(zt) I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:689.1-690.36 - rule testop {C : context, nt : numtype, testop : testop_numtype}: - `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([(nt <: valtype)], [I32_valtype])) + ;; 6-typing.watsup:816.1-818.41 + rule array.len {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:692.1-693.37 - rule relop {C : context, nt : numtype, relop : relop_numtype}: - `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([(nt <: valtype) (nt <: valtype)], [I32_valtype])) + ;; 6-typing.watsup:812.1-814.41 + rule array.set {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype $unpacktype(zt)], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:696.1-698.23 - rule extend {C : context, n : n, nt : numtype}: - `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([(nt <: valtype)], [(nt <: valtype)])) - -- if (n <= $size(nt <: valtype)) + ;; 6-typing.watsup:807.1-810.43 + rule array.get {C : context, mut : mut, sx? : sx?, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype], [$unpacktype(zt)])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- if ((sx?{sx} = ?()) <=> (zt = ($unpacktype(zt) <: storagetype))) - ;; 6-typing.watsup:700.1-703.34 - rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([(nt_2 <: valtype)], [(nt_1 <: valtype)])) - -- if (nt_1 =/= nt_2) - -- if ($size(nt_1 <: valtype) = $size(nt_2 <: valtype)) + ;; 6-typing.watsup:801.1-805.23 + rule array.new_data {C : context, mut : mut, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx}: + `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, (t <: storagetype)))) + -- if ((t = (numtype <: valtype)) \/ (t = (vectype <: valtype))) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:705.1-708.50 - rule convert-i {C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr((inn_1 <: numtype), CONVERT_cvtop, (inn_2 <: numtype), sx?{sx}), `%->%`([(inn_2 <: valtype)], [(inn_1 <: valtype)])) - -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> ($size(inn_1 <: valtype) > $size(inn_2 <: valtype))) + ;; 6-typing.watsup:796.1-799.39 + rule array.new_elem {C : context, mut : mut, rt : reftype, x : idx, y : idx}: + `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, (rt <: storagetype)))) + -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y], rt) - ;; 6-typing.watsup:710.1-712.24 - rule convert-f {C : context, fnn_1 : fnn, fnn_2 : fnn}: - `%|-%:%`(C, CVTOP_instr((fnn_1 <: numtype), CONVERT_cvtop, (fnn_2 <: numtype), ?()), `%->%`([(fnn_2 <: valtype)], [(fnn_1 <: valtype)])) - -- if (fnn_1 =/= fnn_2) + ;; 6-typing.watsup:792.1-794.41 + rule array.new_fixed {C : context, mut : mut, n : n, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpacktype(zt)], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - ;; 6-typing.watsup:717.1-719.31 - rule ref.null {C : context, ht : heaptype}: - `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:787.1-790.40 + rule array.new_default {C : context, mut : mut, val : val, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- if ($default($unpacktype(zt)) = ?(val)) - ;; 6-typing.watsup:722.1-724.23 - rule ref.func {C : context, dt : deftype, epsilon : resulttype, x : idx}: - `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), (dt <: heaptype))])) - -- if (C.FUNC_context[x] = dt) + ;; 6-typing.watsup:783.1-785.41 + rule array.new {C : context, mut : mut, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpacktype(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - ;; 6-typing.watsup:726.1-727.34 - rule ref.i31 {C : context}: - `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) + ;; 6-typing.watsup:775.1-778.24 + rule struct.set {C : context, i : nat, x : idx, yt* : fieldtype*, zt : storagetype}: + `%|-%:%`(C, STRUCT.SET_instr(x, i), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) $unpacktype(zt)], [])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) + -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) - ;; 6-typing.watsup:729.1-730.31 - rule ref.is_null {C : context, rt : reftype}: - `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([(rt <: valtype)], [I32_valtype])) + ;; 6-typing.watsup:769.1-773.43 + rule struct.get {C : context, i : nat, mut : mut, sx? : sx?, x : idx, yt* : fieldtype*, zt : storagetype}: + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx}, x, i), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype))], [$unpacktype(zt)])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) + -- if (yt*{yt}[i] = `%%`(mut, zt)) + -- if ((sx?{sx} = ?()) <=> (zt = ($unpacktype(zt) <: storagetype))) - ;; 6-typing.watsup:732.1-734.31 - rule ref.as_non_null {C : context, ht : heaptype}: - `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:764.1-767.43 + rule struct.new_default {C : context, mut* : mut*, val* : val*, x : idx, zt* : storagetype*}: + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} - ;; 6-typing.watsup:736.1-737.51 - rule ref.eq {C : context}: - `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) + ;; 6-typing.watsup:760.1-762.43 + rule struct.new {C : context, mut* : mut*, x : idx, zt* : storagetype*}: + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - ;; 6-typing.watsup:739.1-743.33 - rule ref.test {C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([(rt' <: valtype)], [I32_valtype])) - -- Reftype_ok: `%|-%:OK`(C, rt) - -- Reftype_ok: `%|-%:OK`(C, rt') - -- Reftype_sub: `%|-%<:%`(C, rt, rt') + ;; 6-typing.watsup:754.1-755.42 + rule i31.get {C : context, sx : sx}: + `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) ;; 6-typing.watsup:745.1-749.33 rule ref.cast {C : context, rt : reftype, rt' : reftype}: @@ -2349,241 +2497,243 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- Reftype_ok: `%|-%:OK`(C, rt') -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:754.1-755.42 - rule i31.get {C : context, sx : sx}: - `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) + ;; 6-typing.watsup:739.1-743.33 + rule ref.test {C : context, rt : reftype, rt' : reftype}: + `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([(rt' <: valtype)], [I32_valtype])) + -- Reftype_ok: `%|-%:OK`(C, rt) + -- Reftype_ok: `%|-%:OK`(C, rt') + -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:760.1-762.43 - rule struct.new {C : context, mut* : mut*, x : idx, zt* : storagetype*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + ;; 6-typing.watsup:736.1-737.51 + rule ref.eq {C : context}: + `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) - ;; 6-typing.watsup:764.1-767.43 - rule struct.new_default {C : context, mut* : mut*, val* : val*, x : idx, zt* : storagetype*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} + ;; 6-typing.watsup:732.1-734.31 + rule ref.as_non_null {C : context, ht : heaptype}: + `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:769.1-773.43 - rule struct.get {C : context, i : nat, mut : mut, sx? : sx?, x : idx, yt* : fieldtype*, zt : storagetype}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx}, x, i), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype))], [$unpacktype(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(mut, zt)) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpacktype(zt) <: storagetype))) + ;; 6-typing.watsup:729.1-730.31 + rule ref.is_null {C : context, rt : reftype}: + `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([(rt <: valtype)], [I32_valtype])) - ;; 6-typing.watsup:775.1-778.24 - rule struct.set {C : context, i : nat, x : idx, yt* : fieldtype*, zt : storagetype}: - `%|-%:%`(C, STRUCT.SET_instr(x, i), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) $unpacktype(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) - - ;; 6-typing.watsup:783.1-785.41 - rule array.new {C : context, mut : mut, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpacktype(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - - ;; 6-typing.watsup:787.1-790.40 - rule array.new_default {C : context, mut : mut, val : val, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - -- if ($default($unpacktype(zt)) = ?(val)) - - ;; 6-typing.watsup:792.1-794.41 - rule array.new_fixed {C : context, mut : mut, n : n, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpacktype(zt)], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - - ;; 6-typing.watsup:796.1-799.39 - rule array.new_elem {C : context, mut : mut, rt : reftype, x : idx, y : idx}: - `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, (rt <: storagetype)))) - -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y], rt) + ;; 6-typing.watsup:726.1-727.34 + rule ref.i31 {C : context}: + `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) - ;; 6-typing.watsup:801.1-805.23 - rule array.new_data {C : context, mut : mut, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx}: - `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), ($idx(x) <: heaptype))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, (t <: storagetype)))) - -- if ((t = (numtype <: valtype)) \/ (t = (vectype <: valtype))) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:722.1-724.23 + rule ref.func {C : context, dt : deftype, epsilon : resulttype, x : idx}: + `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), (dt <: heaptype))])) + -- if (C.FUNC_context[x] = dt) - ;; 6-typing.watsup:807.1-810.43 - rule array.get {C : context, mut : mut, sx? : sx?, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype], [$unpacktype(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = ($unpacktype(zt) <: storagetype))) + ;; 6-typing.watsup:717.1-719.31 + rule ref.null {C : context, ht : heaptype}: + `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:812.1-814.41 - rule array.set {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype $unpacktype(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:710.1-712.24 + rule convert-f {C : context, fnn_1 : fnn, fnn_2 : fnn}: + `%|-%:%`(C, CVTOP_instr((fnn_1 <: numtype), CONVERT_cvtop, (fnn_2 <: numtype), ?()), `%->%`([(fnn_2 <: valtype)], [(fnn_1 <: valtype)])) + -- if (fnn_1 =/= fnn_2) - ;; 6-typing.watsup:816.1-818.41 - rule array.len {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:705.1-708.50 + rule convert-i {C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: + `%|-%:%`(C, CVTOP_instr((inn_1 <: numtype), CONVERT_cvtop, (inn_2 <: numtype), sx?{sx}), `%->%`([(inn_2 <: valtype)], [(inn_1 <: valtype)])) + -- if (inn_1 =/= inn_2) + -- if ((sx?{sx} = ?()) <=> ($size(inn_1 <: valtype) > $size(inn_2 <: valtype))) - ;; 6-typing.watsup:820.1-822.41 - rule array.fill {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype $unpacktype(zt) I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:700.1-703.34 + rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype}: + `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([(nt_2 <: valtype)], [(nt_1 <: valtype)])) + -- if (nt_1 =/= nt_2) + -- if ($size(nt_1 <: valtype) = $size(nt_2 <: valtype)) - ;; 6-typing.watsup:824.1-828.40 - rule array.copy {C : context, mut : mut, x_1 : idx, x_2 : idx, zt_1 : storagetype, zt_2 : storagetype}: - `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x_1) <: heaptype)) I32_valtype REF_valtype(`NULL%?`(?(())), ($idx(x_2) <: heaptype)) I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x_1], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) - -- Expand: `%~~%`(C.TYPE_context[x_2], ARRAY_comptype(`%%`(mut, zt_2))) - -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) + ;; 6-typing.watsup:696.1-698.23 + rule extend {C : context, n : n, nt : numtype}: + `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([(nt <: valtype)], [(nt <: valtype)])) + -- if (n <= $size(nt <: valtype)) - ;; 6-typing.watsup:830.1-833.43 - rule array.init_elem {C : context, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- Storagetype_sub: `%|-%<:%`(C, (C.ELEM_context[y] <: storagetype), zt) + ;; 6-typing.watsup:692.1-693.37 + rule relop {C : context, nt : numtype, relop : relop_numtype}: + `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([(nt <: valtype) (nt <: valtype)], [I32_valtype])) - ;; 6-typing.watsup:835.1-839.23 - rule array.init_data {C : context, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype)) I32_valtype I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- if ((t = (numtype <: valtype)) \/ (t = (vectype <: valtype))) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:689.1-690.36 + rule testop {C : context, nt : numtype, testop : testop_numtype}: + `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([(nt <: valtype)], [I32_valtype])) - ;; 6-typing.watsup:844.1-845.62 - rule extern.convert_any {C : context, nul : nul}: - `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) + ;; 6-typing.watsup:686.1-687.36 + rule binop {C : context, binop : binop_numtype, nt : numtype}: + `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([(nt <: valtype) (nt <: valtype)], [(nt <: valtype)])) - ;; 6-typing.watsup:847.1-848.62 - rule any.convert_extern {C : context, nul : nul}: - `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) + ;; 6-typing.watsup:683.1-684.31 + rule unop {C : context, nt : numtype, unop : unop_numtype}: + `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([(nt <: valtype)], [(nt <: valtype)])) - ;; 6-typing.watsup:853.1-855.28 - rule local.get {C : context, init : init, t : valtype, x : idx}: - `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) - -- if (C.LOCAL_context[x] = `%%`(init, t)) + ;; 6-typing.watsup:680.1-681.33 + rule const {C : context, c_nt : c, nt : numtype}: + `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [(nt <: valtype)])) - ;; 6-typing.watsup:868.1-870.28 - rule global.get {C : context, mut : mut, t : valtype, x : idx}: - `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) - -- if (C.GLOBAL_context[x] = `%%`(mut, t)) + ;; 6-typing.watsup:669.1-675.40 + rule return_call_indirect {C : context, lim : limits, rt : reftype, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx, y : idx}: + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) + -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:872.1-874.28 - rule global.set {C : context, t : valtype, x : idx}: - `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) - -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?(())), t)) + ;; 6-typing.watsup:663.1-667.40 + rule return_call_ref {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype))], t_4*{t_4})) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:879.1-881.28 - rule table.get {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [(rt <: valtype)])) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:657.1-661.40 + rule return_call {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) + -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:883.1-885.28 - rule table.set {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype (rt <: valtype)], [])) + ;; 6-typing.watsup:651.1-655.46 + rule call_indirect {C : context, lim : limits, rt : reftype, t_1* : valtype*, t_2* : valtype*, x : idx, y : idx}: + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) + -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:887.1-889.24 - rule table.size {C : context, tt : tabletype, x : idx}: - `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) - -- if (C.TABLE_context[x] = tt) + ;; 6-typing.watsup:647.1-649.46 + rule call_ref {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), ($idx(x) <: heaptype))], t_2*{t_2})) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:891.1-893.28 - rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([(rt <: valtype) I32_valtype], [I32_valtype])) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:643.1-645.46 + rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: + `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:895.1-897.28 - rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype (rt <: valtype) I32_valtype], [])) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:639.1-641.24 + rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- if (C.RETURN_context = ?(t*{t})) - ;; 6-typing.watsup:899.1-903.36 - rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt_1 : reftype, rt_2 : reftype, x_1 : idx, x_2 : idx}: - `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt_1)) - -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt_2)) + ;; 6-typing.watsup:628.1-634.49 + rule br_on_cast_fail {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 <: valtype)], t*{t} :: [(rt_2 <: valtype)])) + -- if (C.LABEL_context[l] = t*{t} :: [(rt <: valtype)]) + -- Reftype_ok: `%|-%:OK`(C, rt_1) + -- Reftype_ok: `%|-%:OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) - ;; 6-typing.watsup:905.1-909.36 - rule table.init {C : context, lim : limits, rt_1 : reftype, rt_2 : reftype, x : idx, y : idx}: - `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.TABLE_context[x] = `%%`(lim, rt_1)) - -- if (C.ELEM_context[y] = rt_2) + ;; 6-typing.watsup:620.1-626.34 + rule br_on_cast {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [(rt_1 <: valtype)], t*{t} :: [($diffrt(rt_1, rt_2) <: valtype)])) + -- if (C.LABEL_context[l] = t*{t} :: [(rt <: valtype)]) + -- Reftype_ok: `%|-%:OK`(C, rt_1) + -- Reftype_ok: `%|-%:OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) - ;; 6-typing.watsup:911.1-913.23 - rule elem.drop {C : context, rt : reftype, x : idx}: - `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) - -- if (C.ELEM_context[x] = rt) - - ;; 6-typing.watsup:918.1-920.22 - rule memory.size {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:615.1-618.31 + rule br_on_non_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) + -- if (C.LABEL_context[l] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:922.1-924.22 - rule memory.grow {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:610.1-613.31 + rule br_on_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) + -- if (C.LABEL_context[l] = t*{t}) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:926.1-928.22 - rule memory.fill {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:605.1-608.44 + rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- (Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l]))*{l} + -- Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l']) - ;; 6-typing.watsup:930.1-933.26 - rule memory.copy {C : context, mt_1 : memtype, mt_2 : memtype, x_1 : idx, x_2 : idx}: - `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x_1] = mt_1) - -- if (C.MEM_context[x_2] = mt_2) + ;; 6-typing.watsup:601.1-603.24 + rule br_if {C : context, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) + -- if (C.LABEL_context[l] = t*{t}) - ;; 6-typing.watsup:935.1-938.23 - rule memory.init {C : context, mt : memtype, x : idx, y : idx}: - `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x] = mt) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:597.1-599.24 + rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- if (C.LABEL_context[l] = t*{t}) - ;; 6-typing.watsup:940.1-942.23 - rule data.drop {C : context, x : idx}: - `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) - -- if (C.DATA_context[x] = OK) + ;; 6-typing.watsup:588.1-592.65 + rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) - ;; 6-typing.watsup:944.1-949.29 - rule load {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, x : idx}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [(nt <: valtype)])) - -- if (C.MEM_context[x] = mt) - -- if ((2 ^ n_A) <= ($size(nt <: valtype) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt <: valtype) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn <: numtype))) + ;; 6-typing.watsup:583.1-586.61 + rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - ;; 6-typing.watsup:951.1-956.29 - rule store {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, x : idx}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype (nt <: valtype)], [])) - -- if (C.MEM_context[x] = mt) - -- if ((2 ^ n_A) <= ($size(nt <: valtype) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size(nt <: valtype) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = (inn <: numtype))) + ;; 6-typing.watsup:578.1-581.61 + rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + + ;; 6-typing.watsup:557.1-560.37 + rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: + `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) + -- Valtype_sub: `%|-%<:%`(C, t, t') + -- if ((t' = (numtype <: valtype)) \/ (t' = (vectype <: valtype))) + + ;; 6-typing.watsup:554.1-555.31 + rule select-expl {C : context, t : valtype}: + `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) + + ;; 6-typing.watsup:550.1-551.23 + rule drop {C : context, t : valtype}: + `%|-%:%`(C, DROP_instr, `%->%`([t], [])) + + ;; 6-typing.watsup:547.1-548.24 + rule nop {C : context}: + `%|-%:%`(C, NOP_instr, `%->%`([], [])) + + ;; 6-typing.watsup:544.1-545.34 + rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) ;; 6-typing.watsup:504.1-504.67 relation Instrf_ok: `%|-%:%`(context, instr, instrtype) - ;; 6-typing.watsup:518.1-520.41 - rule instr {C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + ;; 6-typing.watsup:861.1-863.28 + rule local.tee {C : context, init : init, t : valtype, x : idx}: + `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) + -- if (C.LOCAL_context[x] = `%%`(init, t)) ;; 6-typing.watsup:857.1-859.28 rule local.set {C : context, init : init, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) -- if (C.LOCAL_context[x] = `%%`(init, t)) - ;; 6-typing.watsup:861.1-863.28 - rule local.tee {C : context, init : init, t : valtype, x : idx}: - `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) - -- if (C.LOCAL_context[x] = `%%`(init, t)) + ;; 6-typing.watsup:518.1-520.41 + rule instr {C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) ;; 6-typing.watsup:505.1-505.74 relation Instrs_ok: `%|-%*:%`(context, instr*, instrtype) - ;; 6-typing.watsup:522.1-523.29 - rule empty {C : context}: - `%|-%*:%`(C, [], `%->%*%`([], [], [])) + ;; 6-typing.watsup:537.1-539.47 + rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%*:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + + ;; 6-typing.watsup:532.1-535.35 + rule sub {C : context, instr* : instr*, it : instrtype, it' : instrtype}: + `%|-%*:%`(C, instr*{instr}, it') + -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, it) + -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:525.1-530.52 rule seq {C : context, C' : context, init* : init*, instr_1 : instr, instr_2* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, x_1* : idx*, x_2* : idx*}: @@ -2593,16 +2743,9 @@ relation Instrs_ok: `%|-%*:%`(context, instr*, instrtype) -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) -- Instrs_ok: `%|-%*:%`(C', instr_2*{instr_2}, `%->%*%`(t_2*{t_2}, x_2*{x_2}, t_3*{t_3})) - ;; 6-typing.watsup:532.1-535.35 - rule sub {C : context, instr* : instr*, it : instrtype, it' : instrtype}: - `%|-%*:%`(C, instr*{instr}, it') - -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, it) - -- Instrtype_sub: `%|-%<:%`(C, it, it') - - ;; 6-typing.watsup:537.1-539.47 - rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%*:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:522.1-523.29 + rule empty {C : context}: + `%|-%*:%`(C, [], `%->%*%`([], [], [])) } ;; 6-typing.watsup:506.1-506.72 @@ -2617,10 +2760,10 @@ rec { ;; 6-typing.watsup:985.1-985.64 def in_binop : (binop_numtype, ibinop*) -> bool - ;; 6-typing.watsup:986.1-986.38 - def {binop : binop_numtype, epsilon : ibinop*} in_binop(binop, epsilon) = false ;; 6-typing.watsup:987.1-987.92 def {binop : binop_numtype, ibinop'* : ibinop*, ibinop_1 : ibinop} in_binop(binop, [ibinop_1] :: ibinop'*{ibinop'}) = ((binop = _I_binop_numtype(ibinop_1)) \/ $in_binop(binop, ibinop'*{ibinop'})) + ;; 6-typing.watsup:986.1-986.38 + def {binop : binop_numtype, epsilon : ibinop*} in_binop(binop, epsilon) = false } ;; 6-typing.watsup:981.1-981.63 @@ -2628,36 +2771,36 @@ rec { ;; 6-typing.watsup:981.1-981.63 def in_numtype : (numtype, numtype*) -> bool - ;; 6-typing.watsup:982.1-982.37 - def {epsilon : numtype*, nt : numtype} in_numtype(nt, epsilon) = false ;; 6-typing.watsup:983.1-983.68 def {nt : numtype, nt'* : numtype*, nt_1 : numtype} in_numtype(nt, [nt_1] :: nt'*{nt'}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt'})) + ;; 6-typing.watsup:982.1-982.37 + def {epsilon : numtype*, nt : numtype} in_numtype(nt, epsilon) = false } ;; 6-typing.watsup:963.1-963.78 relation Instr_const: `%|-%CONST`(context, instr) - ;; 6-typing.watsup:967.1-968.26 - rule const {C : context, c : c, nt : numtype}: - `%|-%CONST`(C, CONST_instr(nt, c)) + ;; 6-typing.watsup:989.1-992.38 + rule binop {C : context, binop : binop_numtype, nt : numtype}: + `%|-%CONST`(C, BINOP_instr(nt, binop)) + -- if $in_numtype(nt, [I32_numtype I64_numtype]) + -- if $in_binop(binop, [ADD_ibinop SUB_ibinop MUL_ibinop]) - ;; 6-typing.watsup:970.1-971.27 - rule ref.null {C : context, ht : heaptype}: - `%|-%CONST`(C, REF.NULL_instr(ht)) + ;; 6-typing.watsup:976.1-978.24 + rule global.get {C : context, t : valtype, x : idx}: + `%|-%CONST`(C, GLOBAL.GET_instr(x)) + -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?()), t)) ;; 6-typing.watsup:973.1-974.26 rule ref.func {C : context, x : idx}: `%|-%CONST`(C, REF.FUNC_instr(x)) - ;; 6-typing.watsup:976.1-978.24 - rule global.get {C : context, t : valtype, x : idx}: - `%|-%CONST`(C, GLOBAL.GET_instr(x)) - -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?()), t)) + ;; 6-typing.watsup:970.1-971.27 + rule ref.null {C : context, ht : heaptype}: + `%|-%CONST`(C, REF.NULL_instr(ht)) - ;; 6-typing.watsup:989.1-992.38 - rule binop {C : context, binop : binop_numtype, nt : numtype}: - `%|-%CONST`(C, BINOP_instr(nt, binop)) - -- if $in_numtype(nt, [I32_numtype I64_numtype]) - -- if $in_binop(binop, [ADD_ibinop SUB_ibinop MUL_ibinop]) + ;; 6-typing.watsup:967.1-968.26 + rule const {C : context, c : c, nt : numtype}: + `%|-%CONST`(C, CONST_instr(nt, c)) ;; 6-typing.watsup:964.1-964.77 relation Expr_const: `%|-%CONST`(context, expr) @@ -2685,16 +2828,16 @@ relation Type_ok: `%|-%:%*`(context, type, deftype*) ;; 6-typing.watsup:1013.1-1013.74 relation Local_ok: `%|-%:%`(context, local, localtype) - ;; 6-typing.watsup:1029.1-1031.28 - rule set {C : context, t : valtype}: - `%|-%:%`(C, LOCAL(t), `%%`(SET_init, t)) - -- if ($default(t) =/= ?()) - ;; 6-typing.watsup:1033.1-1035.26 rule unset {C : context, t : valtype}: `%|-%:%`(C, LOCAL(t), `%%`(UNSET_init, t)) -- if ($default(t) = ?()) + ;; 6-typing.watsup:1029.1-1031.28 + rule set {C : context, t : valtype}: + `%|-%:%`(C, LOCAL(t), `%%`(SET_init, t)) + -- if ($default(t) =/= ?()) + ;; 6-typing.watsup:1012.1-1012.73 relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup:1037.1-1041.82 @@ -2731,19 +2874,19 @@ relation Mem_ok: `%|-%:%`(context, mem, memtype) ;; 6-typing.watsup:1019.1-1019.77 relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) - ;; 6-typing.watsup:1068.1-1071.45 - rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} + ;; 6-typing.watsup:1076.1-1077.20 + rule declare {C : context, rt : reftype}: + `%|-%:%`(C, DECLARE_elemmode, rt) ;; 6-typing.watsup:1073.1-1074.20 rule passive {C : context, rt : reftype}: `%|-%:%`(C, PASSIVE_elemmode, rt) - ;; 6-typing.watsup:1076.1-1077.20 - rule declare {C : context, rt : reftype}: - `%|-%:%`(C, DECLARE_elemmode, rt) + ;; 6-typing.watsup:1068.1-1071.45 + rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup:1017.1-1017.73 relation Elem_ok: `%|-%:%`(context, elem, reftype) @@ -2755,16 +2898,16 @@ relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup:1020.1-1020.77 relation Datamode_ok: `%|-%:OK`(context, datamode) + ;; 6-typing.watsup:1084.1-1085.20 + rule passive {C : context}: + `%|-%:OK`(C, PASSIVE_datamode) + ;; 6-typing.watsup:1079.1-1082.45 rule active {C : context, expr : expr, mt : memtype, x : idx}: `%|-%:OK`(C, ACTIVE_datamode(x, expr)) -- if (C.MEM_context[x] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 6-typing.watsup:1084.1-1085.20 - rule passive {C : context}: - `%|-%:OK`(C, PASSIVE_datamode) - ;; 6-typing.watsup:1018.1-1018.73 relation Data_ok: `%|-%:OK`(context, data) ;; 6-typing.watsup:1064.1-1066.37 @@ -2788,25 +2931,25 @@ relation Import_ok: `%|-%:%`(context, import, externtype) ;; 6-typing.watsup:1096.1-1096.83 relation Externidx_ok: `%|-%:%`(context, externidx, externtype) - ;; 6-typing.watsup:1107.1-1109.23 - rule func {C : context, dt : deftype, x : idx}: - `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) - -- if (C.FUNC_context[x] = dt) - - ;; 6-typing.watsup:1111.1-1113.25 - rule global {C : context, gt : globaltype, x : idx}: - `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) - -- if (C.GLOBAL_context[x] = gt) + ;; 6-typing.watsup:1119.1-1121.22 + rule mem {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) + -- if (C.MEM_context[x] = mt) ;; 6-typing.watsup:1115.1-1117.24 rule table {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE_externidx(x), TABLE_externtype(tt)) -- if (C.TABLE_context[x] = tt) - ;; 6-typing.watsup:1119.1-1121.22 - rule mem {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:1111.1-1113.25 + rule global {C : context, gt : globaltype, x : idx}: + `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) + -- if (C.GLOBAL_context[x] = gt) + + ;; 6-typing.watsup:1107.1-1109.23 + rule func {C : context, dt : deftype, x : idx}: + `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) + -- if (C.FUNC_context[x] = dt) ;; 6-typing.watsup:1095.1-1095.80 relation Export_ok: `%|-%:%`(context, export, externtype) @@ -2820,15 +2963,15 @@ rec { ;; 6-typing.watsup:1128.1-1128.77 relation Globals_ok: `%|-%*:%*`(context, global*, globaltype*) - ;; 6-typing.watsup:1171.1-1172.17 - rule empty {C : context}: - `%|-%*:%*`(C, [], []) - ;; 6-typing.watsup:1174.1-1177.54 rule cons {C : context, global : global, global_1 : global, gt* : globaltype*, gt_1 : globaltype}: `%|-%*:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt}) -- Global_ok: `%|-%:%`(C, global, gt_1) -- Globals_ok: `%|-%*:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt}) + + ;; 6-typing.watsup:1171.1-1172.17 + rule empty {C : context}: + `%|-%*:%*`(C, [], []) } ;; 6-typing.watsup:1127.1-1127.75 @@ -2836,15 +2979,15 @@ rec { ;; 6-typing.watsup:1127.1-1127.75 relation Types_ok: `%|-%*:%*`(context, type*, deftype*) - ;; 6-typing.watsup:1163.1-1164.17 - rule empty {C : context}: - `%|-%*:%*`(C, [], []) - ;; 6-typing.watsup:1166.1-1169.49 rule cons {C : context, dt* : deftype*, dt_1 : deftype, type* : type*, type_1 : type}: `%|-%*:%*`(C, [type_1] :: type*{type}, dt_1*{} :: dt*{dt}) -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) -- Types_ok: `%|-%*:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, dt*{dt}) + + ;; 6-typing.watsup:1163.1-1164.17 + rule empty {C : context}: + `%|-%*:%*`(C, [], []) } ;; 6-typing.watsup:1126.1-1126.76 @@ -2871,474 +3014,485 @@ relation Module_ok: `|-%:OK`(module) ;; 7-runtime-typing.watsup:5.1-5.40 relation Ref_ok: `%|-%:%`(store, ref, reftype) - ;; 7-runtime-typing.watsup:7.1-8.35 - rule null {ht : heaptype, s : store}: - `%|-%:%`(s, REF.NULL_ref(ht), REF_reftype(`NULL%?`(?(())), ht)) + ;; 7-runtime-typing.watsup:28.1-29.45 + rule extern {addrref : addrref, s : store}: + `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) - ;; 7-runtime-typing.watsup:10.1-11.37 - rule i31 {i : nat, s : store}: - `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) + ;; 7-runtime-typing.watsup:25.1-26.39 + rule host {a : addr, s : store}: + `%|-%:%`(s, REF.HOST_ADDR_ref(a), REF_reftype(`NULL%?`(?()), ANY_heaptype)) - ;; 7-runtime-typing.watsup:13.1-15.30 - rule struct {a : addr, dt : deftype, s : store}: - `%|-%:%`(s, REF.STRUCT_ADDR_ref(a), REF_reftype(`NULL%?`(?()), (dt <: heaptype))) - -- if (s.STRUCT_store[a].TYPE_structinst = dt) + ;; 7-runtime-typing.watsup:21.1-23.28 + rule func {a : addr, dt : deftype, s : store}: + `%|-%:%`(s, REF.FUNC_ADDR_ref(a), REF_reftype(`NULL%?`(?()), (dt <: heaptype))) + -- if (s.FUNC_store[a].TYPE_funcinst = dt) ;; 7-runtime-typing.watsup:17.1-19.29 rule array {a : addr, dt : deftype, s : store}: `%|-%:%`(s, REF.ARRAY_ADDR_ref(a), REF_reftype(`NULL%?`(?()), (dt <: heaptype))) -- if (s.ARRAY_store[a].TYPE_arrayinst = dt) - ;; 7-runtime-typing.watsup:21.1-23.28 - rule func {a : addr, dt : deftype, s : store}: - `%|-%:%`(s, REF.FUNC_ADDR_ref(a), REF_reftype(`NULL%?`(?()), (dt <: heaptype))) - -- if (s.FUNC_store[a].TYPE_funcinst = dt) + ;; 7-runtime-typing.watsup:13.1-15.30 + rule struct {a : addr, dt : deftype, s : store}: + `%|-%:%`(s, REF.STRUCT_ADDR_ref(a), REF_reftype(`NULL%?`(?()), (dt <: heaptype))) + -- if (s.STRUCT_store[a].TYPE_structinst = dt) - ;; 7-runtime-typing.watsup:25.1-26.39 - rule host {a : addr, s : store}: - `%|-%:%`(s, REF.HOST_ADDR_ref(a), REF_reftype(`NULL%?`(?()), ANY_heaptype)) + ;; 7-runtime-typing.watsup:10.1-11.37 + rule i31 {i : nat, s : store}: + `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) - ;; 7-runtime-typing.watsup:28.1-29.45 - rule extern {addrref : addrref, s : store}: - `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) + ;; 7-runtime-typing.watsup:7.1-8.35 + rule null {ht : heaptype, s : store}: + `%|-%:%`(s, REF.NULL_ref(ht), REF_reftype(`NULL%?`(?(())), ht)) ;; 8-reduction.watsup:6.1-6.63 relation Step_pure: `%*~>%*`(admininstr*, admininstr*) - ;; 8-reduction.watsup:42.1-43.24 - rule unreachable: - `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) - - ;; 8-reduction.watsup:45.1-46.15 - rule nop: - `%*~>%*`([NOP_admininstr], []) - - ;; 8-reduction.watsup:48.1-49.20 - rule drop {val : val}: - `%*~>%*`([(val <: admininstr) DROP_admininstr], []) - - ;; 8-reduction.watsup:52.1-54.16 - rule select-true {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: - `%*~>%*`([(val_1 <: admininstr) (val_2 <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_1 <: admininstr)]) - -- if (c =/= 0) + ;; 8-reduction.watsup:552.1-553.47 + rule local.tee {val : val, x : idx}: + `%*~>%*`([(val <: admininstr) LOCAL.TEE_admininstr(x)], [(val <: admininstr) (val <: admininstr) LOCAL.SET_admininstr(x)]) - ;; 8-reduction.watsup:56.1-58.14 - rule select-false {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: - `%*~>%*`([(val_1 <: admininstr) (val_2 <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_2 <: admininstr)]) - -- if (c = 0) + ;; 8-reduction.watsup:539.1-540.55 + rule any.convert_extern-addr {addrref : addrref}: + `%*~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref <: admininstr)]) - ;; 8-reduction.watsup:76.1-78.16 - rule if-true {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) - -- if (c =/= 0) + ;; 8-reduction.watsup:536.1-537.55 + rule any.convert_extern-null {ht : heaptype}: + `%*~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) - ;; 8-reduction.watsup:80.1-82.14 - rule if-false {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) - -- if (c = 0) + ;; 8-reduction.watsup:532.1-533.55 + rule extern.convert_any-addr {addrref : addrref}: + `%*~>%*`([(addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) - ;; 8-reduction.watsup:85.1-86.38 - rule label-vals {instr* : instr*, n : n, val* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr*{instr}, (val <: admininstr)*{val})], (val <: admininstr)*{val}) + ;; 8-reduction.watsup:529.1-530.58 + rule extern.convert_any-null {ht : heaptype}: + `%*~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) - ;; 8-reduction.watsup:92.1-93.69 - rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val' <: admininstr)*{val'} :: (val <: admininstr)^n{val} :: [BR_admininstr(0)] :: (instr <: admininstr)*{instr})], (val <: admininstr)^n{val} :: (instr' <: admininstr)*{instr'}) + ;; 8-reduction.watsup:311.1-312.68 + rule i31.get-num {i : nat, sx : sx}: + `%*~>%*`([REF.I31_NUM_admininstr(i) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, i))]) - ;; 8-reduction.watsup:95.1-96.65 - rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val <: admininstr)*{val} :: [BR_admininstr(l + 1)] :: (instr <: admininstr)*{instr})], (val <: admininstr)*{val} :: [BR_admininstr(l)]) + ;; 8-reduction.watsup:308.1-309.39 + rule i31.get-null {ht : heaptype, sx : sx}: + `%*~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) - ;; 8-reduction.watsup:99.1-101.16 - rule br_if-true {c : c, l : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) - -- if (c =/= 0) + ;; 8-reduction.watsup:281.1-283.15 + rule ref.eq-false {ref_1 : ref, ref_2 : ref}: + `%*~>%*`([(ref_1 <: admininstr) (ref_2 <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 0)]) + -- otherwise - ;; 8-reduction.watsup:103.1-105.14 - rule br_if-false {c : c, l : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) - -- if (c = 0) + ;; 8-reduction.watsup:276.1-279.22 + rule ref.eq-true {ref_1 : ref, ref_2 : ref}: + `%*~>%*`([(ref_1 <: admininstr) (ref_2 <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- otherwise + -- if (ref_1 = ref_2) - ;; 8-reduction.watsup:108.1-110.17 - rule br_table-lt {i : nat, l* : labelidx*, l' : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) - -- if (i < |l*{l}|) + ;; 8-reduction.watsup:272.1-274.55 + rule ref.eq-null {ht_1 : heaptype, ht_2 : heaptype, ref_1 : ref, ref_2 : ref}: + `%*~>%*`([(ref_1 <: admininstr) (ref_2 <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) - ;; 8-reduction.watsup:112.1-114.18 - rule br_table-ge {i : nat, l* : labelidx*, l' : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) - -- if (i >= |l*{l}|) + ;; 8-reduction.watsup:267.1-269.15 + rule ref.as_non_null-addr {ref : ref}: + `%*~>%*`([(ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref <: admininstr)]) + -- otherwise - ;; 8-reduction.watsup:117.1-119.26 - rule br_on_null-null {ht : heaptype, l : labelidx, val : val}: - `%*~>%*`([(val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) - -- if (val = REF.NULL_val(ht)) + ;; 8-reduction.watsup:263.1-265.28 + rule ref.as_non_null-null {ht : heaptype, ref : ref}: + `%*~>%*`([(ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) + -- if (ref = REF.NULL_ref(ht)) - ;; 8-reduction.watsup:121.1-123.15 - rule br_on_null-addr {l : labelidx, val : val}: - `%*~>%*`([(val <: admininstr) BR_ON_NULL_admininstr(l)], [(val <: admininstr)]) + ;; 8-reduction.watsup:258.1-260.15 + rule ref.is_null-false {val : val}: + `%*~>%*`([(val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 8-reduction.watsup:126.1-128.26 - rule br_on_non_null-null {ht : heaptype, l : labelidx, val : val}: - `%*~>%*`([(val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) + ;; 8-reduction.watsup:254.1-256.28 + rule ref.is_null-true {ht : heaptype, val : val}: + `%*~>%*`([(val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:130.1-132.15 - rule br_on_non_null-addr {l : labelidx, val : val}: - `%*~>%*`([(val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val <: admininstr) BR_admininstr(l)]) - -- otherwise - - ;; 8-reduction.watsup:186.1-187.84 - rule call_indirect-call {x : idx, y : idx}: - `%*~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) <: heaptype))) CALL_REF_admininstr(?(y))]) + ;; 8-reduction.watsup:250.1-251.60 + rule ref.i31 {i : nat}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, i))]) - ;; 8-reduction.watsup:189.1-190.98 - rule return_call_indirect {x : idx, y : idx}: - `%*~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) + ;; 8-reduction.watsup:240.1-242.50 + rule cvtop-trap {c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: + `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) + -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = []) - ;; 8-reduction.watsup:193.1-194.35 - rule frame-vals {f : frame, n : n, val^n : val^n}: - `%*~>%*`([FRAME__admininstr(n, f, (val <: admininstr)^n{val})], (val <: admininstr)^n{val}) + ;; 8-reduction.watsup:236.1-238.48 + rule cvtop-val {c : c, c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: + `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) + -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = [c]) - ;; 8-reduction.watsup:196.1-197.55 - rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: - `%*~>%*`([FRAME__admininstr(n, f, (val' <: admininstr)*{val'} :: (val <: admininstr)^n{val} :: [RETURN_admininstr] :: (instr <: admininstr)*{instr})], (val <: admininstr)^n{val}) + ;; 8-reduction.watsup:232.1-233.70 + rule extend {c : c, n : n, nt : numtype}: + `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, $size(nt <: valtype), S_sx, c))]) - ;; 8-reduction.watsup:199.1-200.60 - rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: - `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, (val <: admininstr)*{val} :: [RETURN_admininstr] :: (instr <: admininstr)*{instr})], (val <: admininstr)*{val} :: [RETURN_admininstr]) + ;; 8-reduction.watsup:227.1-229.40 + rule relop {c : c, c_1 : c, c_2 : c, nt : numtype, relop : relop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) + -- if (c = $relop(relop, nt, c_1, c_2)) - ;; 8-reduction.watsup:205.1-207.33 - rule unop-val {c : c, c_1 : c, nt : numtype, unop : unop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) - -- if ($unop(unop, nt, c_1) = [c]) + ;; 8-reduction.watsup:223.1-225.37 + rule testop {c : c, c_1 : c, nt : numtype, testop : testop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) + -- if (c = $testop(testop, nt, c_1)) - ;; 8-reduction.watsup:209.1-211.35 - rule unop-trap {c_1 : c, nt : numtype, unop : unop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) - -- if ($unop(unop, nt, c_1) = []) + ;; 8-reduction.watsup:218.1-220.42 + rule binop-trap {binop : binop_numtype, c_1 : c, c_2 : c, nt : numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) + -- if ($binop(binop, nt, c_1, c_2) = []) ;; 8-reduction.watsup:214.1-216.40 rule binop-val {binop : binop_numtype, c : c, c_1 : c, c_2 : c, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(binop, nt, c_1, c_2) = [c]) - ;; 8-reduction.watsup:218.1-220.42 - rule binop-trap {binop : binop_numtype, c_1 : c, c_2 : c, nt : numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) - -- if ($binop(binop, nt, c_1, c_2) = []) - - ;; 8-reduction.watsup:223.1-225.37 - rule testop {c : c, c_1 : c, nt : numtype, testop : testop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) - -- if (c = $testop(testop, nt, c_1)) + ;; 8-reduction.watsup:209.1-211.35 + rule unop-trap {c_1 : c, nt : numtype, unop : unop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) + -- if ($unop(unop, nt, c_1) = []) - ;; 8-reduction.watsup:227.1-229.40 - rule relop {c : c, c_1 : c, c_2 : c, nt : numtype, relop : relop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) - -- if (c = $relop(relop, nt, c_1, c_2)) + ;; 8-reduction.watsup:205.1-207.33 + rule unop-val {c : c, c_1 : c, nt : numtype, unop : unop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) + -- if ($unop(unop, nt, c_1) = [c]) - ;; 8-reduction.watsup:232.1-233.70 - rule extend {c : c, n : n, nt : numtype}: - `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, $size(nt <: valtype), S_sx, c))]) + ;; 8-reduction.watsup:199.1-200.60 + rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: + `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, (val <: admininstr)*{val} :: [RETURN_admininstr] :: (instr <: admininstr)*{instr})], (val <: admininstr)*{val} :: [RETURN_admininstr]) - ;; 8-reduction.watsup:236.1-238.48 - rule cvtop-val {c : c, c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: - `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) - -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = [c]) + ;; 8-reduction.watsup:196.1-197.55 + rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: + `%*~>%*`([FRAME__admininstr(n, f, (val' <: admininstr)*{val'} :: (val <: admininstr)^n{val} :: [RETURN_admininstr] :: (instr <: admininstr)*{instr})], (val <: admininstr)^n{val}) - ;; 8-reduction.watsup:240.1-242.50 - rule cvtop-trap {c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: - `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) - -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = []) + ;; 8-reduction.watsup:193.1-194.35 + rule frame-vals {f : frame, n : n, val^n : val^n}: + `%*~>%*`([FRAME__admininstr(n, f, (val <: admininstr)^n{val})], (val <: admininstr)^n{val}) - ;; 8-reduction.watsup:250.1-251.60 - rule ref.i31 {i : nat}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, i))]) + ;; 8-reduction.watsup:189.1-190.98 + rule return_call_indirect {x : idx, y : idx}: + `%*~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) <: heaptype))) RETURN_CALL_REF_admininstr(?(y))]) - ;; 8-reduction.watsup:254.1-256.28 - rule ref.is_null-true {ht : heaptype, val : val}: - `%*~>%*`([(val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- if (val = REF.NULL_val(ht)) + ;; 8-reduction.watsup:186.1-187.84 + rule call_indirect-call {x : idx, y : idx}: + `%*~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), ($idx(y) <: heaptype))) CALL_REF_admininstr(?(y))]) - ;; 8-reduction.watsup:258.1-260.15 - rule ref.is_null-false {val : val}: - `%*~>%*`([(val <: admininstr) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) + ;; 8-reduction.watsup:130.1-132.15 + rule br_on_non_null-addr {l : labelidx, val : val}: + `%*~>%*`([(val <: admininstr) BR_ON_NON_NULL_admininstr(l)], [(val <: admininstr) BR_admininstr(l)]) -- otherwise - ;; 8-reduction.watsup:263.1-265.28 - rule ref.as_non_null-null {ht : heaptype, ref : ref}: - `%*~>%*`([(ref <: admininstr) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) - -- if (ref = REF.NULL_ref(ht)) + ;; 8-reduction.watsup:126.1-128.26 + rule br_on_non_null-null {ht : heaptype, l : labelidx, val : val}: + `%*~>%*`([(val <: admininstr) BR_ON_NON_NULL_admininstr(l)], []) + -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:267.1-269.15 - rule ref.as_non_null-addr {ref : ref}: - `%*~>%*`([(ref <: admininstr) REF.AS_NON_NULL_admininstr], [(ref <: admininstr)]) + ;; 8-reduction.watsup:121.1-123.15 + rule br_on_null-addr {l : labelidx, val : val}: + `%*~>%*`([(val <: admininstr) BR_ON_NULL_admininstr(l)], [(val <: admininstr)]) -- otherwise - ;; 8-reduction.watsup:272.1-274.55 - rule ref.eq-null {ht_1 : heaptype, ht_2 : heaptype, ref_1 : ref, ref_2 : ref}: - `%*~>%*`([(ref_1 <: admininstr) (ref_2 <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) + ;; 8-reduction.watsup:117.1-119.26 + rule br_on_null-null {ht : heaptype, l : labelidx, val : val}: + `%*~>%*`([(val <: admininstr) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) + -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:276.1-279.22 - rule ref.eq-true {ref_1 : ref, ref_2 : ref}: - `%*~>%*`([(ref_1 <: admininstr) (ref_2 <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- otherwise - -- if (ref_1 = ref_2) + ;; 8-reduction.watsup:112.1-114.18 + rule br_table-ge {i : nat, l* : labelidx*, l' : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) + -- if (i >= |l*{l}|) - ;; 8-reduction.watsup:281.1-283.15 - rule ref.eq-false {ref_1 : ref, ref_2 : ref}: - `%*~>%*`([(ref_1 <: admininstr) (ref_2 <: admininstr) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 0)]) - -- otherwise + ;; 8-reduction.watsup:108.1-110.17 + rule br_table-lt {i : nat, l* : labelidx*, l' : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) + -- if (i < |l*{l}|) - ;; 8-reduction.watsup:308.1-309.39 - rule i31.get-null {ht : heaptype, sx : sx}: - `%*~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) + ;; 8-reduction.watsup:103.1-105.14 + rule br_if-false {c : c, l : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) + -- if (c = 0) - ;; 8-reduction.watsup:311.1-312.68 - rule i31.get-num {i : nat, sx : sx}: - `%*~>%*`([REF.I31_NUM_admininstr(i) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, i))]) + ;; 8-reduction.watsup:99.1-101.16 + rule br_if-true {c : c, l : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) + -- if (c =/= 0) - ;; 8-reduction.watsup:529.1-530.58 - rule extern.convert_any-null {ht : heaptype}: - `%*~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) + ;; 8-reduction.watsup:95.1-96.65 + rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val <: admininstr)*{val} :: [BR_admininstr(l + 1)] :: (instr <: admininstr)*{instr})], (val <: admininstr)*{val} :: [BR_admininstr(l)]) - ;; 8-reduction.watsup:532.1-533.55 - rule extern.convert_any-addr {addrref : addrref}: - `%*~>%*`([(addrref <: admininstr) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) + ;; 8-reduction.watsup:92.1-93.69 + rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, (val' <: admininstr)*{val'} :: (val <: admininstr)^n{val} :: [BR_admininstr(0)] :: (instr <: admininstr)*{instr})], (val <: admininstr)^n{val} :: (instr' <: admininstr)*{instr'}) - ;; 8-reduction.watsup:536.1-537.55 - rule any.convert_extern-null {ht : heaptype}: - `%*~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) + ;; 8-reduction.watsup:85.1-86.38 + rule label-vals {instr* : instr*, n : n, val* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr*{instr}, (val <: admininstr)*{val})], (val <: admininstr)*{val}) - ;; 8-reduction.watsup:539.1-540.55 - rule any.convert_extern-addr {addrref : addrref}: - `%*~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [(addrref <: admininstr)]) + ;; 8-reduction.watsup:80.1-82.14 + rule if-false {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) + -- if (c = 0) - ;; 8-reduction.watsup:552.1-553.47 - rule local.tee {val : val, x : idx}: - `%*~>%*`([(val <: admininstr) LOCAL.TEE_admininstr(x)], [(val <: admininstr) (val <: admininstr) LOCAL.SET_admininstr(x)]) + ;; 8-reduction.watsup:76.1-78.16 + rule if-true {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) + -- if (c =/= 0) + + ;; 8-reduction.watsup:56.1-58.14 + rule select-false {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: + `%*~>%*`([(val_1 <: admininstr) (val_2 <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_2 <: admininstr)]) + -- if (c = 0) + + ;; 8-reduction.watsup:52.1-54.16 + rule select-true {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: + `%*~>%*`([(val_1 <: admininstr) (val_2 <: admininstr) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [(val_1 <: admininstr)]) + -- if (c =/= 0) + + ;; 8-reduction.watsup:48.1-49.20 + rule drop {val : val}: + `%*~>%*`([(val <: admininstr) DROP_admininstr], []) + + ;; 8-reduction.watsup:45.1-46.15 + rule nop: + `%*~>%*`([NOP_admininstr], []) + + ;; 8-reduction.watsup:42.1-43.24 + rule unreachable: + `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) ;; 8-reduction.watsup:63.1-63.73 def blocktype : (state, blocktype) -> functype - ;; 8-reduction.watsup:64.1-64.44 - def {z : state} blocktype(z, _RESULT_blocktype(?())) = `%->%`([], []) - ;; 8-reduction.watsup:65.1-65.40 - def {t : valtype, z : state} blocktype(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) ;; 8-reduction.watsup:66.1-66.66 def {ft : functype, x : idx, z : state} blocktype(z, _IDX_blocktype(x)) = ft -- Expand: `%~~%`($type(z, x), FUNC_comptype(ft)) + ;; 8-reduction.watsup:65.1-65.40 + def {t : valtype, z : state} blocktype(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) + ;; 8-reduction.watsup:64.1-64.44 + def {z : state} blocktype(z, _RESULT_blocktype(?())) = `%->%`([], []) ;; 8-reduction.watsup:7.1-7.63 relation Step_read: `%~>%*`(config, admininstr*) - ;; 8-reduction.watsup:68.1-70.43 - rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: - `%~>%*`(`%;%*`(z, (val <: admininstr)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], (val <: admininstr)^k{val} :: (instr <: admininstr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + ;; 8-reduction.watsup:753.1-757.15 + rule memory.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, y).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x, y)]) + -- otherwise - ;; 8-reduction.watsup:72.1-74.43 - rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: - `%~>%*`(`%;%*`(z, (val <: admininstr)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], (val <: admininstr)^k{val} :: (instr <: admininstr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + ;; 8-reduction.watsup:748.1-751.14 + rule memory.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:135.1-138.66 - rule br_on_cast-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref <: admininstr) BR_admininstr(l)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt) - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) + ;; 8-reduction.watsup:744.1-746.70 + rule memory.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) - ;; 8-reduction.watsup:140.1-142.15 - rule br_on_cast-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref <: admininstr)]) + ;; 8-reduction.watsup:737.1-741.15 + rule memory.copy-gt {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise - ;; 8-reduction.watsup:145.1-148.66 - rule br_on_cast_fail-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref <: admininstr)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt) - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) + ;; 8-reduction.watsup:730.1-735.19 + rule memory.copy-le {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, (i_1 + 1)) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) + -- otherwise + -- if (i_1 <= i_2) - ;; 8-reduction.watsup:150.1-152.15 - rule br_on_cast_fail-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref <: admininstr) BR_admininstr(l)]) + ;; 8-reduction.watsup:725.1-728.14 + rule memory.copy-zero {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), []) -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:157.1-158.62 - rule call {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) CALL_REF_admininstr(?())]) + ;; 8-reduction.watsup:721.1-723.77 + rule memory.copy-oob {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) - ;; 8-reduction.watsup:160.1-161.43 - rule call_ref-null {ht : heaptype, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) + ;; 8-reduction.watsup:714.1-718.15 + rule memory.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) (val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (i + 1)) (val <: admininstr) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr(x)]) + -- otherwise - ;; 8-reduction.watsup:163.1-168.59 - rule call_ref-func {a : addr, f : frame, fi : funcinst, instr* : instr*, m : m, n : n, t* : valtype*, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, x? : idx?, y : idx, z : state}: - `%~>%*`(`%;%*`(z, (val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr <: admininstr)*{instr})])]) - -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) - -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) + ;; 8-reduction.watsup:709.1-712.14 + rule memory.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:171.1-172.76 - rule return_call {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) RETURN_CALL_REF_admininstr(?())]) + ;; 8-reduction.watsup:705.1-707.37 + rule memory.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:175.1-176.78 - rule return_call_ref-frame-null {f : frame, ht : heaptype, instr* : instr*, k : nat, val* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val <: admininstr)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr <: admininstr)*{instr})]), [TRAP_admininstr]) + ;; 8-reduction.watsup:692.1-694.44 + rule memory.size {n : n, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) + -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:178.1-180.59 - rule return_call_ref-frame-addr {a : addr, f : frame, instr* : instr*, k : nat, m : m, n : n, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, val'* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' <: admininstr)*{val'} :: (val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr <: admininstr)*{instr})]), (val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + ;; 8-reduction.watsup:670.1-672.61 + rule load-pack-val {c : c, i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [CONST_admininstr(nt, $ext(n, $size(nt <: valtype), sx, c))]) + -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) - ;; 8-reduction.watsup:182.1-183.91 - rule return_call_ref-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, (val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr <: admininstr)*{instr})]), (val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) + ;; 8-reduction.watsup:666.1-668.51 + rule load-pack-oob {i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [TRAP_admininstr]) + -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:247.1-248.55 - rule ref.func {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) + ;; 8-reduction.watsup:662.1-664.71 + rule load-num-val {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) + -- if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : ($size(nt <: valtype) / 8)]) - ;; 8-reduction.watsup:286.1-289.65 - rule ref.test-true {ref : ref, rt : reftype, rt' : reftype, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 1)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt') - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) + ;; 8-reduction.watsup:658.1-660.59 + rule load-num-oob {i : nat, mo : memop, nt : numtype, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) + -- if (((i + mo.OFFSET_memop) + ($size(nt <: valtype) / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:291.1-293.15 - rule ref.test-false {ref : ref, rt : reftype, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 0)]) + ;; 8-reduction.watsup:645.1-649.15 + rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) ($elem(z, y).ELEM_eleminst[i] <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.INIT_admininstr(x, y)]) -- otherwise - ;; 8-reduction.watsup:296.1-299.65 - rule ref.cast-succeed {ref : ref, rt : reftype, rt' : reftype, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref <: admininstr)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt') - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) - - ;; 8-reduction.watsup:301.1-303.15 - rule ref.cast-fail {ref : ref, rt : reftype, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:640.1-643.14 + rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), []) -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:322.1-325.43 - rule struct.new_default {mut* : mut*, val* : val*, x : idx, z : state, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val <: admininstr)*{val} :: [STRUCT.NEW_admininstr(x)]) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} + ;; 8-reduction.watsup:636.1-638.72 + rule table.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) - ;; 8-reduction.watsup:328.1-329.50 - rule struct.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:629.1-633.15 + rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) + -- otherwise - ;; 8-reduction.watsup:331.1-334.41 - rule struct.get-struct {a : addr, i : nat, mut* : mut*, si : structinst, sx? : sx?, x : idx, z : state, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]) <: admininstr)]) - -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + ;; 8-reduction.watsup:622.1-627.15 + rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) + -- otherwise + -- if (j <= i) - ;; 8-reduction.watsup:348.1-349.70 - rule array.new {n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [(val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.NEW_admininstr(x)]), (val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + ;; 8-reduction.watsup:617.1-620.14 + rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:351.1-354.40 - rule array.new_default {mut : mut, n : n, val : val, x : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) ARRAY.NEW_DEFAULT_admininstr(x)]), (val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ($default($unpacktype(zt)) = ?(val)) + ;; 8-reduction.watsup:613.1-615.73 + rule table.copy-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) - ;; 8-reduction.watsup:362.1-364.38 - rule array.new_elem-oob {i : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) + ;; 8-reduction.watsup:606.1-610.15 + rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) (val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) (val <: admininstr) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) + -- otherwise - ;; 8-reduction.watsup:366.1-368.40 - rule array.new_elem-alloc {i : nat, n : n, ref^n : ref^n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref <: admininstr)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) + ;; 8-reduction.watsup:601.1-604.14 + rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:371.1-374.59 - rule array.new_data-oob {i : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) + ;; 8-reduction.watsup:597.1-599.39 + rule table.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:376.1-380.88 - rule array.new_data-alloc {c^n : c^n, i : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (nt = $unpacknumtype(zt)) - -- if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) + ;; 8-reduction.watsup:584.1-586.32 + rule table.size {n : n, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) + -- if (|$table(z, x).ELEM_tableinst| = n) - ;; 8-reduction.watsup:383.1-384.61 - rule array.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:571.1-573.32 + rule table.get-val {i : nat, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] <: admininstr)]) + -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:386.1-388.38 - rule array.get-oob {a : addr, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) - -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:567.1-569.33 + rule table.get-oob {i : nat, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) + -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:390.1-393.53 - rule array.get-array {a : addr, fv : fieldval, i : nat, mut : mut, sx? : sx?, x : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [($unpackval(zt, sx?{sx}, fv) <: admininstr)]) - -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) - -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) + ;; 8-reduction.watsup:558.1-559.45 + rule global.get {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst <: admininstr)]) - ;; 8-reduction.watsup:409.1-410.39 - rule array.len-null {ht : heaptype, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) + ;; 8-reduction.watsup:545.1-547.27 + rule local.get {val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [(val <: admininstr)]) + -- if ($local(z, x) = ?(val)) - ;; 8-reduction.watsup:412.1-414.37 - rule array.len-array {a : addr, n : n, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, n)]) - -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:517.1-524.67 + rule array.init_data-succ {a : addr, c : c, i : nat, j : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + ($storagesize(zt) / 8))) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_DATA_admininstr(x, y)]) + -- otherwise + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (nt = $unpacknumtype(zt)) + -- if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) - ;; 8-reduction.watsup:417.1-418.76 - rule array.fill-null {ht : heaptype, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:512.1-515.14 + rule array.init_data-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:420.1-422.44 - rule array.fill-oob {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:507.1-510.59 + rule array.init_data-oob2 {a : addr, i : nat, j : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) + + ;; 8-reduction.watsup:503.1-505.44 + rule array.init_data-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:424.1-427.14 - rule array.fill-zero {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:500.1-501.93 + rule array.init_data-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:429.1-433.15 - rule array.fill-succ {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) (val <: admininstr) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.FILL_admininstr(x)]) + ;; 8-reduction.watsup:492.1-497.34 + rule array.init_elem-succ {a : addr, i : nat, j : nat, n : n, ref : ref, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_ELEM_admininstr(x, y)]) -- otherwise + -- if (ref = $elem(z, y).ELEM_eleminst[j]) - ;; 8-reduction.watsup:435.1-436.102 - rule array.copy-null1 {ht_1 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, i_1) (ref <: admininstr) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:487.1-490.14 + rule array.init_elem-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:438.1-439.102 - rule array.copy-null2 {ht_2 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [(ref <: admininstr) CONST_admininstr(I32_numtype, i_1) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:483.1-485.38 + rule array.init_elem-oob2 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) - ;; 8-reduction.watsup:441.1-443.48 - rule array.copy-oob1 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) + ;; 8-reduction.watsup:479.1-481.44 + rule array.init_elem-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:445.1-447.48 - rule array.copy-oob2 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) + ;; 8-reduction.watsup:476.1-477.93 + rule array.init_elem-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:449.1-452.14 - rule array.copy-zero {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), []) + ;; 8-reduction.watsup:465.1-473.29 + rule array.copy-gt {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise - -- if (n = 0) + -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) + -- if (sx?{sx} = $sxfield(zt_2)) ;; 8-reduction.watsup:454.1-463.19 rule array.copy-le {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: @@ -3348,352 +3502,341 @@ relation Step_read: `%~>%*`(config, admininstr*) -- if (sx?{sx} = $sxfield(zt_2)) -- if (i_1 <= i_2) - ;; 8-reduction.watsup:465.1-473.29 - rule array.copy-gt {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) + ;; 8-reduction.watsup:449.1-452.14 + rule array.copy-zero {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), []) -- otherwise - -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (n = 0) - ;; 8-reduction.watsup:476.1-477.93 - rule array.init_elem-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:445.1-447.48 + rule array.copy-oob2 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) - ;; 8-reduction.watsup:479.1-481.44 - rule array.init_elem-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:441.1-443.48 + rule array.copy-oob1 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) - ;; 8-reduction.watsup:483.1-485.38 - rule array.init_elem-oob2 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) + ;; 8-reduction.watsup:438.1-439.102 + rule array.copy-null2 {ht_2 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) CONST_admininstr(I32_numtype, i_1) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:487.1-490.14 - rule array.init_elem-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:435.1-436.102 + rule array.copy-null1 {ht_1 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, i_1) (ref <: admininstr) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:492.1-497.34 - rule array.init_elem-succ {a : addr, i : nat, j : nat, n : n, ref : ref, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (ref <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_ELEM_admininstr(x, y)]) + ;; 8-reduction.watsup:429.1-433.15 + rule array.fill-succ {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) (val <: admininstr) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.FILL_admininstr(x)]) -- otherwise - -- if (ref = $elem(z, y).ELEM_eleminst[j]) - - ;; 8-reduction.watsup:500.1-501.93 - rule array.init_data-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - - ;; 8-reduction.watsup:503.1-505.44 - rule array.init_data-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - - ;; 8-reduction.watsup:507.1-510.59 - rule array.init_data-oob2 {a : addr, i : nat, j : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) - ;; 8-reduction.watsup:512.1-515.14 - rule array.init_data-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), []) + ;; 8-reduction.watsup:424.1-427.14 + rule array.fill-zero {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 8-reduction.watsup:517.1-524.67 - rule array.init_data-succ {a : addr, c : c, i : nat, j : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + ($storagesize(zt) / 8))) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_DATA_admininstr(x, y)]) - -- otherwise - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (nt = $unpacknumtype(zt)) - -- if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) + ;; 8-reduction.watsup:420.1-422.44 + rule array.fill-oob {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:545.1-547.27 - rule local.get {val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [(val <: admininstr)]) - -- if ($local(z, x) = ?(val)) + ;; 8-reduction.watsup:417.1-418.76 + rule array.fill-null {ht : heaptype, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:558.1-559.45 - rule global.get {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [($global(z, x).VALUE_globalinst <: admininstr)]) + ;; 8-reduction.watsup:412.1-414.37 + rule array.len-array {a : addr, n : n, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, n)]) + -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:567.1-569.33 - rule table.get-oob {i : nat, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) - -- if (i >= |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:409.1-410.39 + rule array.len-null {ht : heaptype, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) - ;; 8-reduction.watsup:571.1-573.32 - rule table.get-val {i : nat, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [($table(z, x).ELEM_tableinst[i] <: admininstr)]) - -- if (i < |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:390.1-393.53 + rule array.get-array {a : addr, fv : fieldval, i : nat, mut : mut, sx? : sx?, x : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [($unpackval(zt, sx?{sx}, fv) <: admininstr)]) + -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) + -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) - ;; 8-reduction.watsup:584.1-586.32 - rule table.size {n : n, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) - -- if (|$table(z, x).ELEM_tableinst| = n) + ;; 8-reduction.watsup:386.1-388.38 + rule array.get-oob {a : addr, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:597.1-599.39 - rule table.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:383.1-384.61 + rule array.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:601.1-604.14 - rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:376.1-380.88 + rule array.new_data-alloc {c^n : c^n, i : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (nt = $unpacknumtype(zt)) + -- if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) - ;; 8-reduction.watsup:606.1-610.15 - rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) (val <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) (val <: admininstr) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) - -- otherwise + ;; 8-reduction.watsup:371.1-374.59 + rule array.new_data-oob {i : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) - ;; 8-reduction.watsup:613.1-615.73 - rule table.copy-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) + ;; 8-reduction.watsup:366.1-368.40 + rule array.new_elem-alloc {i : nat, n : n, ref^n : ref^n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), (ref <: admininstr)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) - ;; 8-reduction.watsup:617.1-620.14 - rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:362.1-364.38 + rule array.new_elem-oob {i : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) - ;; 8-reduction.watsup:622.1-627.15 - rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) - -- otherwise - -- if (j <= i) + ;; 8-reduction.watsup:351.1-354.40 + rule array.new_default {mut : mut, n : n, val : val, x : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) ARRAY.NEW_DEFAULT_admininstr(x)]), (val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ($default($unpacktype(zt)) = ?(val)) - ;; 8-reduction.watsup:629.1-633.15 - rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) - -- otherwise + ;; 8-reduction.watsup:348.1-349.70 + rule array.new {n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [(val <: admininstr) CONST_admininstr(I32_numtype, n) ARRAY.NEW_admininstr(x)]), (val <: admininstr)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - ;; 8-reduction.watsup:636.1-638.72 - rule table.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) + ;; 8-reduction.watsup:331.1-334.41 + rule struct.get-struct {a : addr, i : nat, mut* : mut*, si : structinst, sx? : sx?, x : idx, z : state, zt* : storagetype*}: + `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]) <: admininstr)]) + -- if ($structinst(z)[a] = si) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - ;; 8-reduction.watsup:640.1-643.14 - rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), []) + ;; 8-reduction.watsup:328.1-329.50 + rule struct.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [TRAP_admininstr]) + + ;; 8-reduction.watsup:322.1-325.43 + rule struct.new_default {mut* : mut*, val* : val*, x : idx, z : state, zt* : storagetype*}: + `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), (val <: admininstr)*{val} :: [STRUCT.NEW_admininstr(x)]) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} + + ;; 8-reduction.watsup:301.1-303.15 + rule ref.cast-fail {ref : ref, rt : reftype, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) -- otherwise - -- if (n = 0) - ;; 8-reduction.watsup:645.1-649.15 - rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) ($elem(z, y).ELEM_eleminst[i] <: admininstr) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.INIT_admininstr(x, y)]) + ;; 8-reduction.watsup:296.1-299.65 + rule ref.cast-succeed {ref : ref, rt : reftype, rt' : reftype, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) REF.CAST_admininstr(rt)]), [(ref <: admininstr)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt') + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) + + ;; 8-reduction.watsup:291.1-293.15 + rule ref.test-false {ref : ref, rt : reftype, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 8-reduction.watsup:658.1-660.59 - rule load-num-oob {i : nat, mo : memop, nt : numtype, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) - -- if (((i + mo.OFFSET_memop) + ($size(nt <: valtype) / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:286.1-289.65 + rule ref.test-true {ref : ref, rt : reftype, rt' : reftype, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 1)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt') + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) - ;; 8-reduction.watsup:662.1-664.71 - rule load-num-val {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) - -- if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : ($size(nt <: valtype) / 8)]) + ;; 8-reduction.watsup:247.1-248.55 + rule ref.func {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) - ;; 8-reduction.watsup:666.1-668.51 - rule load-pack-oob {i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [TRAP_admininstr]) - -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:182.1-183.91 + rule return_call_ref-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, (val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr <: admininstr)*{instr})]), (val <: admininstr)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) - ;; 8-reduction.watsup:670.1-672.61 - rule load-pack-val {c : c, i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [CONST_admininstr(nt, $ext(n, $size(nt <: valtype), sx, c))]) - -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) + ;; 8-reduction.watsup:178.1-180.59 + rule return_call_ref-frame-addr {a : addr, f : frame, instr* : instr*, k : nat, m : m, n : n, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, val'* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val' <: admininstr)*{val'} :: (val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr <: admininstr)*{instr})]), (val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - ;; 8-reduction.watsup:692.1-694.44 - rule memory.size {n : n, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) - -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:175.1-176.78 + rule return_call_ref-frame-null {f : frame, ht : heaptype, instr* : instr*, k : nat, val* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, (val <: admininstr)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: (instr <: admininstr)*{instr})]), [TRAP_admininstr]) - ;; 8-reduction.watsup:705.1-707.37 - rule memory.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:171.1-172.76 + rule return_call {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) RETURN_CALL_REF_admininstr(?())]) - ;; 8-reduction.watsup:709.1-712.14 - rule memory.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:163.1-168.59 + rule call_ref-func {a : addr, f : frame, fi : funcinst, instr* : instr*, m : m, n : n, t* : valtype*, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, x? : idx?, y : idx, z : state}: + `%~>%*`(`%;%*`(z, (val <: admininstr)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], (instr <: admininstr)*{instr})])]) + -- if ($funcinst(z)[a] = fi) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) + -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) - ;; 8-reduction.watsup:714.1-718.15 - rule memory.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (val <: admininstr) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) (val <: admininstr) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (i + 1)) (val <: admininstr) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr(x)]) - -- otherwise + ;; 8-reduction.watsup:160.1-161.43 + rule call_ref-null {ht : heaptype, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) - ;; 8-reduction.watsup:721.1-723.77 - rule memory.copy-oob {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) + ;; 8-reduction.watsup:157.1-158.62 + rule call {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) CALL_REF_admininstr(?())]) - ;; 8-reduction.watsup:725.1-728.14 - rule memory.copy-zero {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), []) + ;; 8-reduction.watsup:150.1-152.15 + rule br_on_cast_fail-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref <: admininstr) BR_admininstr(l)]) -- otherwise - -- if (n = 0) - ;; 8-reduction.watsup:730.1-735.19 - rule memory.copy-le {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, (i_1 + 1)) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) - -- otherwise - -- if (i_1 <= i_2) + ;; 8-reduction.watsup:145.1-148.66 + rule br_on_cast_fail-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [(ref <: admininstr)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt) + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) - ;; 8-reduction.watsup:737.1-741.15 - rule memory.copy-gt {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) + ;; 8-reduction.watsup:140.1-142.15 + rule br_on_cast-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref <: admininstr)]) -- otherwise - ;; 8-reduction.watsup:744.1-746.70 - rule memory.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) + ;; 8-reduction.watsup:135.1-138.66 + rule br_on_cast-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [(ref <: admininstr) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [(ref <: admininstr) BR_admininstr(l)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt) + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) - ;; 8-reduction.watsup:748.1-751.14 - rule memory.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:72.1-74.43 + rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: + `%~>%*`(`%;%*`(z, (val <: admininstr)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], (val <: admininstr)^k{val} :: (instr <: admininstr)*{instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 8-reduction.watsup:753.1-757.15 - rule memory.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, y).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x, y)]) - -- otherwise + ;; 8-reduction.watsup:68.1-70.43 + rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: + `%~>%*`(`%;%*`(z, (val <: admininstr)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], (val <: admininstr)^k{val} :: (instr <: admininstr)*{instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) ;; 8-reduction.watsup:5.1-5.63 relation Step: `%~>%`(config, config) - ;; 8-reduction.watsup:10.1-12.34 - rule pure {instr* : instr*, instr'* : instr*, z : state}: - `%~>%`(`%;%*`(z, (instr <: admininstr)*{instr}), `%;%*`(z, (instr' <: admininstr)*{instr'})) - -- Step_pure: `%*~>%*`((instr <: admininstr)*{instr}, (instr' <: admininstr)*{instr'}) - - ;; 8-reduction.watsup:14.1-16.37 - rule read {instr* : instr*, instr'* : instr*, z : state}: - `%~>%`(`%;%*`(z, (instr <: admininstr)*{instr}), `%;%*`(z, (instr' <: admininstr)*{instr'})) - -- Step_read: `%~>%*`(`%;%*`(z, (instr <: admininstr)*{instr}), (instr' <: admininstr)*{instr'}) + ;; 8-reduction.watsup:760.1-761.51 + rule data.drop {x : idx, z : state}: + `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) - ;; 8-reduction.watsup:317.1-320.61 - rule struct.new {mut^n : mut^n, n : n, si : structinst, val^n : val^n, x : idx, z : state, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, (val <: admininstr)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) - -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) + ;; 8-reduction.watsup:701.1-702.77 + rule memory.grow-fail {n : n, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) - ;; 8-reduction.watsup:337.1-338.53 - rule struct.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) (val <: admininstr) STRUCT.SET_admininstr(x, i)]), `%;%*`(z, [TRAP_admininstr])) + ;; 8-reduction.watsup:697.1-699.40 + rule memory.grow-succeed {mi : meminst, n : n, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, (|$mem(z, x).DATA_meminst| / (64 * $Ki)))])) + -- if (mi = $growmemory($mem(z, x), n)) - ;; 8-reduction.watsup:340.1-343.35 - rule struct.set-struct {a : addr, fv : fieldval, i : nat, mut* : mut*, val : val, x : idx, z : state, zt* : storagetype*}: - `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val <: admininstr) STRUCT.SET_admininstr(x, i)]), `%;%*`($with_struct(z, a, i, fv), [])) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + ;; 8-reduction.watsup:687.1-689.48 + rule store-pack-val {b* : byte*, c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (n / 8), b*{b}), [])) + -- if (b*{b} = $ibytes(n, $wrap($size(nt <: valtype), n, c))) - ;; 8-reduction.watsup:356.1-359.61 - rule array.new_fixed {ai : arrayinst, mut : mut, n : n, val^n : val^n, x : idx, z : state, zt : storagetype}: - `%~>%`(`%;%*`(z, (val <: admininstr)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) + ;; 8-reduction.watsup:683.1-685.51 + rule store-pack-oob {c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:396.1-397.64 - rule array.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) (val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + ;; 8-reduction.watsup:679.1-681.29 + rule store-num-val {b* : byte*, c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), ($size(nt <: valtype) / 8), b*{b}), [])) + -- if (b*{b} = $ntbytes(nt, c)) - ;; 8-reduction.watsup:399.1-401.38 - rule array.set-oob {a : addr, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) - -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:675.1-677.59 + rule store-num-oob {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + -- if (((i + mo.OFFSET_memop) + ($size(nt <: valtype) / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:403.1-406.31 - rule array.set-array {a : addr, fv : fieldval, i : nat, mut : mut, val : val, x : idx, z : state, zt : storagetype}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) - -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) - -- if (fv = $packval(zt, val)) + ;; 8-reduction.watsup:652.1-653.51 + rule elem.drop {x : idx, z : state}: + `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) - ;; 8-reduction.watsup:549.1-550.56 - rule local.set {val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [(val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) + ;; 8-reduction.watsup:593.1-594.80 + rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: + `%~>%`(`%;%*`(z, [(ref <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) - ;; 8-reduction.watsup:561.1-562.58 - rule global.set {val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [(val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) + ;; 8-reduction.watsup:589.1-591.46 + rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state}: + `%~>%`(`%;%*`(z, [(ref <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) + -- if (ti = $growtable($table(z, x), n, ref)) + + ;; 8-reduction.watsup:579.1-581.32 + rule table.set-val {i : nat, ref : ref, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) + -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup:575.1-577.33 rule table.set-oob {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:579.1-581.32 - rule table.set-val {i : nat, ref : ref, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) (ref <: admininstr) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) - -- if (i < |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:561.1-562.58 + rule global.set {val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [(val <: admininstr) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) - ;; 8-reduction.watsup:589.1-591.46 - rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state}: - `%~>%`(`%;%*`(z, [(ref <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) - -- if (ti = $growtable($table(z, x), n, ref)) + ;; 8-reduction.watsup:549.1-550.56 + rule local.set {val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [(val <: admininstr) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) - ;; 8-reduction.watsup:593.1-594.80 - rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: - `%~>%`(`%;%*`(z, [(ref <: admininstr) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) + ;; 8-reduction.watsup:403.1-406.31 + rule array.set-array {a : addr, fv : fieldval, i : nat, mut : mut, val : val, x : idx, z : state, zt : storagetype}: + `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) + -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) + -- if (fv = $packval(zt, val)) - ;; 8-reduction.watsup:652.1-653.51 - rule elem.drop {x : idx, z : state}: - `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) + ;; 8-reduction.watsup:399.1-401.38 + rule array.set-oob {a : addr, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) (val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:675.1-677.59 - rule store-num-oob {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if (((i + mo.OFFSET_memop) + ($size(nt <: valtype) / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:396.1-397.64 + rule array.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) (val <: admininstr) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) - ;; 8-reduction.watsup:679.1-681.29 - rule store-num-val {b* : byte*, c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), ($size(nt <: valtype) / 8), b*{b}), [])) - -- if (b*{b} = $ntbytes(nt, c)) + ;; 8-reduction.watsup:356.1-359.61 + rule array.new_fixed {ai : arrayinst, mut : mut, n : n, val^n : val^n, x : idx, z : state, zt : storagetype}: + `%~>%`(`%;%*`(z, (val <: admininstr)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) - ;; 8-reduction.watsup:683.1-685.51 - rule store-pack-oob {c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:340.1-343.35 + rule struct.set-struct {a : addr, fv : fieldval, i : nat, mut* : mut*, val : val, x : idx, z : state, zt* : storagetype*}: + `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) (val <: admininstr) STRUCT.SET_admininstr(x, i)]), `%;%*`($with_struct(z, a, i, fv), [])) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- if (fv = $packval(zt*{zt}[i], val)) - ;; 8-reduction.watsup:687.1-689.48 - rule store-pack-val {b* : byte*, c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (n / 8), b*{b}), [])) - -- if (b*{b} = $ibytes(n, $wrap($size(nt <: valtype), n, c))) + ;; 8-reduction.watsup:337.1-338.53 + rule struct.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) (val <: admininstr) STRUCT.SET_admininstr(x, i)]), `%;%*`(z, [TRAP_admininstr])) - ;; 8-reduction.watsup:697.1-699.40 - rule memory.grow-succeed {mi : meminst, n : n, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, (|$mem(z, x).DATA_meminst| / (64 * $Ki)))])) - -- if (mi = $growmemory($mem(z, x), n)) + ;; 8-reduction.watsup:317.1-320.61 + rule struct.new {mut^n : mut^n, n : n, si : structinst, val^n : val^n, x : idx, z : state, zt^n : storagetype^n}: + `%~>%`(`%;%*`(z, (val <: admininstr)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) + -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) - ;; 8-reduction.watsup:701.1-702.77 - rule memory.grow-fail {n : n, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) + ;; 8-reduction.watsup:14.1-16.37 + rule read {instr* : instr*, instr'* : instr*, z : state}: + `%~>%`(`%;%*`(z, (instr <: admininstr)*{instr}), `%;%*`(z, (instr' <: admininstr)*{instr'})) + -- Step_read: `%~>%*`(`%;%*`(z, (instr <: admininstr)*{instr}), (instr' <: admininstr)*{instr'}) - ;; 8-reduction.watsup:760.1-761.51 - rule data.drop {x : idx, z : state}: - `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) + ;; 8-reduction.watsup:10.1-12.34 + rule pure {instr* : instr*, instr'* : instr*, z : state}: + `%~>%`(`%;%*`(z, (instr <: admininstr)*{instr}), `%;%*`(z, (instr' <: admininstr)*{instr'})) + -- Step_pure: `%*~>%*`((instr <: admininstr)*{instr}, (instr' <: admininstr)*{instr'}) ;; 8-reduction.watsup:8.1-8.63 rec { ;; 8-reduction.watsup:8.1-8.63 relation Steps: `%~>*%`(config, config) - ;; 8-reduction.watsup:18.1-19.36 - rule refl {admininstr* : admininstr*, z : state}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) - ;; 8-reduction.watsup:21.1-24.53 rule trans {admininstr* : admininstr*, admininstr' : admininstr, admininstr''* : admininstr*, z : state, z' : state, z'' : state}: `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z'', admininstr''*{admininstr''})) -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z', admininstr'*{})) -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr''})) + + ;; 8-reduction.watsup:18.1-19.36 + rule refl {admininstr* : admininstr*, z : state}: + `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) } ;; 8-reduction.watsup:29.1-29.69 @@ -3708,14 +3851,14 @@ rec { ;; 9-module.watsup:7.1-7.34 def alloctypes : type* -> deftype* - ;; 9-module.watsup:8.1-8.27 - def alloctypes([]) = [] ;; 9-module.watsup:9.1-13.24 def {deftype* : deftype*, deftype'* : deftype*, rectype : rectype, type : type, type'* : type*, x : idx} alloctypes(type'*{type'} :: [type]) = deftype'*{deftype'} :: deftype*{deftype} -- if (deftype'*{deftype'} = $alloctypes(type'*{type'})) -- if (type = TYPE(rectype)) -- if (deftype*{deftype} = $subst_all_deftypes($rolldt(x, rectype), (deftype' <: heaptype)*{deftype'})) -- if (x = |deftype'*{deftype'}|) + ;; 9-module.watsup:8.1-8.27 + def alloctypes([]) = [] } ;; 9-module.watsup:15.1-15.60 @@ -3730,12 +3873,12 @@ rec { ;; 9-module.watsup:20.1-20.63 def allocfuncs : (store, moduleinst, func*) -> (store, funcaddr*) - ;; 9-module.watsup:21.1-21.39 - def {mm : moduleinst, s : store} allocfuncs(s, mm, []) = (s, []) ;; 9-module.watsup:22.1-24.51 def {fa : funcaddr, fa'* : funcaddr*, func : func, func'* : func*, mm : moduleinst, s : store, s_1 : store, s_2 : store} allocfuncs(s, mm, [func] :: func'*{func'}) = (s_2, [fa] :: fa'*{fa'}) -- if ((s_1, fa) = $allocfunc(s, mm, func)) -- if ((s_2, fa'*{fa'}) = $allocfuncs(s_1, mm, func'*{func'})) + ;; 9-module.watsup:21.1-21.39 + def {mm : moduleinst, s : store} allocfuncs(s, mm, []) = (s, []) } ;; 9-module.watsup:26.1-26.63 @@ -3749,12 +3892,12 @@ rec { ;; 9-module.watsup:30.1-30.67 def allocglobals : (store, globaltype*, val*) -> (store, globaladdr*) - ;; 9-module.watsup:31.1-31.42 - def {s : store} allocglobals(s, [], []) = (s, []) ;; 9-module.watsup:32.1-34.62 def {ga : globaladdr, ga'* : globaladdr*, globaltype : globaltype, globaltype'* : globaltype*, s : store, s_1 : store, s_2 : store, val : val, val'* : val*} allocglobals(s, [globaltype] :: globaltype'*{globaltype'}, [val] :: val'*{val'}) = (s_2, [ga] :: ga'*{ga'}) -- if ((s_1, ga) = $allocglobal(s, globaltype, val)) -- if ((s_2, ga'*{ga'}) = $allocglobals(s_1, globaltype'*{globaltype'}, val'*{val'})) + ;; 9-module.watsup:31.1-31.42 + def {s : store} allocglobals(s, [], []) = (s, []) } ;; 9-module.watsup:36.1-36.60 @@ -3768,12 +3911,12 @@ rec { ;; 9-module.watsup:40.1-40.64 def alloctables : (store, tabletype*, ref*) -> (store, tableaddr*) - ;; 9-module.watsup:41.1-41.41 - def {s : store} alloctables(s, [], []) = (s, []) ;; 9-module.watsup:42.1-44.60 def {ref : ref, ref'* : ref*, s : store, s_1 : store, s_2 : store, ta : tableaddr, ta'* : tableaddr*, tabletype : tabletype, tabletype'* : tabletype*} alloctables(s, [tabletype] :: tabletype'*{tabletype'}, [ref] :: ref'*{ref'}) = (s_2, [ta] :: ta'*{ta'}) -- if ((s_1, ta) = $alloctable(s, tabletype, ref)) -- if ((s_2, ta'*{ta'}) = $alloctables(s_1, tabletype'*{tabletype'}, ref'*{ref'})) + ;; 9-module.watsup:41.1-41.41 + def {s : store} alloctables(s, [], []) = (s, []) } ;; 9-module.watsup:46.1-46.49 @@ -3787,12 +3930,12 @@ rec { ;; 9-module.watsup:50.1-50.52 def allocmems : (store, memtype*) -> (store, memaddr*) - ;; 9-module.watsup:51.1-51.34 - def {s : store} allocmems(s, []) = (s, []) ;; 9-module.watsup:52.1-54.49 def {ma : memaddr, ma'* : memaddr*, memtype : memtype, memtype'* : memtype*, s : store, s_1 : store, s_2 : store} allocmems(s, [memtype] :: memtype'*{memtype'}) = (s_2, [ma] :: ma'*{ma'}) -- if ((s_1, ma) = $allocmem(s, memtype)) -- if ((s_2, ma'*{ma'}) = $allocmems(s_1, memtype'*{memtype'})) + ;; 9-module.watsup:51.1-51.34 + def {s : store} allocmems(s, []) = (s, []) } ;; 9-module.watsup:56.1-56.57 @@ -3806,12 +3949,12 @@ rec { ;; 9-module.watsup:60.1-60.63 def allocelems : (store, reftype*, ref**) -> (store, elemaddr*) - ;; 9-module.watsup:61.1-61.40 - def {s : store} allocelems(s, [], []) = (s, []) ;; 9-module.watsup:62.1-64.55 def {ea : elemaddr, ea'* : elemaddr*, ref* : ref*, ref'** : ref**, rt : reftype, rt'* : reftype*, s : store, s_1 : store, s_2 : store} allocelems(s, [rt] :: rt'*{rt'}, [ref*{ref}] :: ref'*{ref'}*{ref'}) = (s_2, [ea] :: ea'*{ea'}) -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref})) -- if ((s_2, ea'*{ea'}) = $allocelems(s_2, rt'*{rt'}, ref'*{ref'}*{ref'})) + ;; 9-module.watsup:61.1-61.40 + def {s : store} allocelems(s, [], []) = (s, []) } ;; 9-module.watsup:66.1-66.49 @@ -3825,24 +3968,24 @@ rec { ;; 9-module.watsup:70.1-70.54 def allocdatas : (store, byte**) -> (store, dataaddr*) - ;; 9-module.watsup:71.1-71.35 - def {s : store} allocdatas(s, []) = (s, []) ;; 9-module.watsup:72.1-74.50 def {byte* : byte*, byte'** : byte**, da : dataaddr, da'* : dataaddr*, s : store, s_1 : store, s_2 : store} allocdatas(s, [byte*{byte}] :: byte'*{byte'}*{byte'}) = (s_2, [da] :: da'*{da'}) -- if ((s_1, da) = $allocdata(s, byte*{byte})) -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) + ;; 9-module.watsup:71.1-71.35 + def {s : store} allocdatas(s, []) = (s, []) } ;; 9-module.watsup:79.1-79.83 def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst - ;; 9-module.watsup:80.1-80.95 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} - ;; 9-module.watsup:81.1-81.99 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} - ;; 9-module.watsup:82.1-82.97 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} ;; 9-module.watsup:83.1-83.93 def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} + ;; 9-module.watsup:82.1-82.97 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} + ;; 9-module.watsup:81.1-81.99 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} + ;; 9-module.watsup:80.1-80.95 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} ;; 9-module.watsup:86.1-86.87 def allocmodule : (store, module, externval*, val*, ref*, ref**) -> (store, moduleinst) @@ -3874,27 +4017,27 @@ rec { ;; 9-module.watsup:134.1-134.38 def concat_instr : instr** -> instr* - ;; 9-module.watsup:135.1-135.29 - def concat_instr([]) = [] ;; 9-module.watsup:136.1-136.74 def {instr* : instr*, instr'** : instr**} concat_instr([instr*{instr}] :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) + ;; 9-module.watsup:135.1-135.29 + def concat_instr([]) = [] } ;; 9-module.watsup:138.1-138.33 def runelem : (elem, idx) -> instr* - ;; 9-module.watsup:139.1-139.52 - def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, PASSIVE_elemmode), y) = [] - ;; 9-module.watsup:140.1-140.62 - def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] ;; 9-module.watsup:141.1-142.77 def {expr* : expr*, instr* : instr*, reftype : reftype, x : idx, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, ACTIVE_elemmode(x, instr*{instr})), y) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, |expr*{expr}|) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] + ;; 9-module.watsup:140.1-140.62 + def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] + ;; 9-module.watsup:139.1-139.52 + def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, PASSIVE_elemmode), y) = [] ;; 9-module.watsup:144.1-144.33 def rundata : (data, idx) -> instr* - ;; 9-module.watsup:145.1-145.44 - def {byte* : byte*, y : idx} rundata(`DATA%*%`(byte*{byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup:146.1-147.78 def {byte* : byte*, instr* : instr*, x : idx, y : idx} rundata(`DATA%*%`(byte*{byte}, ACTIVE_datamode(x, instr*{instr})), y) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, |byte*{byte}|) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] + ;; 9-module.watsup:145.1-145.44 + def {byte* : byte*, y : idx} rundata(`DATA%*%`(byte*{byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup:149.1-149.53 def instantiate : (store, module, externval*) -> config @@ -3931,20 +4074,20 @@ rec { ;; A-binary.watsup:47.1-47.24 def utf8 : name -> byte* - ;; A-binary.watsup:48.1-48.44 - def {b : byte, c : c} utf8([c]) = [b] - -- if ((c < 128) /\ (c = b)) - ;; A-binary.watsup:49.1-49.93 - def {b_1 : byte, b_2 : byte, c : c} utf8([c]) = [b_1 b_2] - -- if (((128 <= c) /\ (c < 2048)) /\ (c = (((2 ^ 6) * (b_1 - 192)) + (b_2 - 128)))) - ;; A-binary.watsup:50.1-50.144 - def {b_1 : byte, b_2 : byte, b_3 : byte, c : c} utf8([c]) = [b_1 b_2 b_3] - -- if ((((2048 <= c) /\ (c < 55296)) \/ ((57344 <= c) /\ (c < 65536))) /\ (c = ((((2 ^ 12) * (b_1 - 224)) + ((2 ^ 6) * (b_2 - 128))) + (b_3 - 128)))) + ;; A-binary.watsup:52.1-52.41 + def {c* : c*} utf8(c*{c}) = $concat_bytes($utf8([c])*{c}) ;; A-binary.watsup:51.1-51.145 def {b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte, c : c} utf8([c]) = [b_1 b_2 b_3 b_4] -- if (((65536 <= c) /\ (c < 69632)) /\ (c = (((((2 ^ 18) * (b_1 - 240)) + ((2 ^ 12) * (b_2 - 128))) + ((2 ^ 6) * (b_3 - 128))) + (b_4 - 128)))) - ;; A-binary.watsup:52.1-52.41 - def {c* : c*} utf8(c*{c}) = $concat_bytes($utf8([c])*{c}) + ;; A-binary.watsup:50.1-50.144 + def {b_1 : byte, b_2 : byte, b_3 : byte, c : c} utf8([c]) = [b_1 b_2 b_3] + -- if ((((2048 <= c) /\ (c < 55296)) \/ ((57344 <= c) /\ (c < 65536))) /\ (c = ((((2 ^ 12) * (b_1 - 224)) + ((2 ^ 6) * (b_2 - 128))) + (b_3 - 128)))) + ;; A-binary.watsup:49.1-49.93 + def {b_1 : byte, b_2 : byte, c : c} utf8([c]) = [b_1 b_2] + -- if (((128 <= c) /\ (c < 2048)) /\ (c = (((2 ^ 6) * (b_1 - 192)) + (b_2 - 128)))) + ;; A-binary.watsup:48.1-48.44 + def {b : byte, c : c} utf8([c]) = [b] + -- if ((c < 128) /\ (c = b)) } ;; A-binary.watsup:210.1-210.27 @@ -3958,10 +4101,10 @@ rec { ;; A-binary.watsup:665.1-665.62 def concat_locals : local** -> local* - ;; A-binary.watsup:666.1-666.30 - def concat_locals([]) = [] ;; A-binary.watsup:667.1-667.68 def {loc* : local*, loc'** : local**} concat_locals([loc*{loc}] :: loc'*{loc'}*{loc'}) = loc*{loc} :: $concat_locals(loc'*{loc'}*{loc'}) + ;; A-binary.watsup:666.1-666.30 + def concat_locals([]) = [] } ;; A-binary.watsup:670.1-670.29 @@ -3992,12 +4135,12 @@ rec { ;; 0-aux.watsup:27.1-27.25 def min : (nat, nat) -> nat - ;; 0-aux.watsup:28.1-28.19 - def {j : nat} min(0, j) = 0 - ;; 0-aux.watsup:29.1-29.19 - def {i : nat} min(i, 0) = 0 ;; 0-aux.watsup:30.1-30.38 def {i : nat, j : nat} min((i + 1), (j + 1)) = $min(i, j) + ;; 0-aux.watsup:29.1-29.19 + def {i : nat} min(i, 0) = 0 + ;; 0-aux.watsup:28.1-28.19 + def {j : nat} min(0, j) = 0 } ;; 0-aux.watsup:32.1-32.21 @@ -4005,10 +4148,10 @@ rec { ;; 0-aux.watsup:32.1-32.21 def sum : nat* -> nat - ;; 0-aux.watsup:33.1-33.18 - def sum([]) = 0 ;; 0-aux.watsup:34.1-34.35 def {n : n, n'* : n*} sum([n] :: n'*{n'}) = (n + $sum(n'*{n'})) + ;; 0-aux.watsup:33.1-33.18 + def sum([]) = 0 } ;; 1-syntax.watsup:5.1-5.85 @@ -4046,17 +4189,17 @@ syntax s33 = sN ;; 1-syntax.watsup:35.1-35.21 def signif : N -> nat - ;; 1-syntax.watsup:36.1-36.21 - def signif(32) = 23 ;; 1-syntax.watsup:37.1-37.21 def signif(64) = 52 + ;; 1-syntax.watsup:36.1-36.21 + def signif(32) = 23 ;; 1-syntax.watsup:39.1-39.20 def expon : N -> nat - ;; 1-syntax.watsup:40.1-40.19 - def expon(32) = 8 ;; 1-syntax.watsup:41.1-41.20 def expon(64) = 11 + ;; 1-syntax.watsup:40.1-40.19 + def expon(32) = 8 ;; 1-syntax.watsup:43.1-43.35 def M : N -> nat @@ -4602,14 +4745,14 @@ rec { ;; 2-syntax-aux.watsup:8.1-8.33 def setminus1 : (idx, idx*) -> idx* - ;; 2-syntax-aux.watsup:13.1-13.27 - def {x : idx} setminus1(x, []) = [x] - ;; 2-syntax-aux.watsup:14.1-14.57 - def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = [] - -- if (x = y_1) ;; 2-syntax-aux.watsup:15.1-15.60 def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = $setminus1(x, y*{y}) -- otherwise + ;; 2-syntax-aux.watsup:14.1-14.57 + def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = [] + -- if (x = y_1) + ;; 2-syntax-aux.watsup:13.1-13.27 + def {x : idx} setminus1(x, []) = [x] } ;; 2-syntax-aux.watsup:7.1-7.49 @@ -4617,30 +4760,30 @@ rec { ;; 2-syntax-aux.watsup:7.1-7.49 def setminus : (idx*, idx*) -> idx* - ;; 2-syntax-aux.watsup:10.1-10.29 - def {y* : idx*} setminus([], y*{y}) = [] ;; 2-syntax-aux.watsup:11.1-11.66 def {x* : idx*, x_1 : idx, y* : idx*} setminus([x_1] :: x*{x}, y*{y}) = $setminus1(x_1, y*{y}) :: $setminus(x*{x}, y*{y}) + ;; 2-syntax-aux.watsup:10.1-10.29 + def {y* : idx*} setminus([], y*{y}) = [] } ;; 2-syntax-aux.watsup:20.1-20.68 def free_dataidx_instr : instr -> dataidx* - ;; 2-syntax-aux.watsup:21.1-21.45 - def {x : idx, y : idx} free_dataidx_instr(MEMORY.INIT_instr(x, y)) = [y] - ;; 2-syntax-aux.watsup:22.1-22.41 - def {x : idx} free_dataidx_instr(DATA.DROP_instr(x)) = [x] ;; 2-syntax-aux.watsup:23.1-23.34 def {in : instr} free_dataidx_instr(in) = [] + ;; 2-syntax-aux.watsup:22.1-22.41 + def {x : idx} free_dataidx_instr(DATA.DROP_instr(x)) = [x] + ;; 2-syntax-aux.watsup:21.1-21.45 + def {x : idx, y : idx} free_dataidx_instr(MEMORY.INIT_instr(x, y)) = [y] ;; 2-syntax-aux.watsup:25.1-25.70 rec { ;; 2-syntax-aux.watsup:25.1-25.70 def free_dataidx_instrs : instr* -> dataidx* - ;; 2-syntax-aux.watsup:26.1-26.36 - def free_dataidx_instrs([]) = [] ;; 2-syntax-aux.watsup:27.1-27.99 def {instr : instr, instr'* : instr*} free_dataidx_instrs([instr] :: instr'*{instr'}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr'}) + ;; 2-syntax-aux.watsup:26.1-26.36 + def free_dataidx_instrs([]) = [] } ;; 2-syntax-aux.watsup:29.1-29.66 @@ -4658,10 +4801,10 @@ rec { ;; 2-syntax-aux.watsup:35.1-35.68 def free_dataidx_funcs : func* -> dataidx* - ;; 2-syntax-aux.watsup:36.1-36.35 - def free_dataidx_funcs([]) = [] ;; 2-syntax-aux.watsup:37.1-37.92 def {func : func, func'* : func*} free_dataidx_funcs([func] :: func'*{func'}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func'}) + ;; 2-syntax-aux.watsup:36.1-36.35 + def free_dataidx_funcs([]) = [] } ;; 2-syntax-aux.watsup:46.1-46.59 @@ -4669,66 +4812,66 @@ rec { ;; 2-syntax-aux.watsup:46.1-46.59 def concat_bytes : byte** -> byte* - ;; 2-syntax-aux.watsup:47.1-47.29 - def concat_bytes([]) = [] ;; 2-syntax-aux.watsup:48.1-48.58 def {b* : byte*, b'** : byte**} concat_bytes([b*{b}] :: b'*{b'}*{b'}) = b*{b} :: $concat_bytes(b'*{b'}*{b'}) + ;; 2-syntax-aux.watsup:47.1-47.29 + def concat_bytes([]) = [] } ;; 2-syntax-aux.watsup:59.1-59.55 def size : valtype -> nat - ;; 2-syntax-aux.watsup:60.1-60.20 - def size(I32_valtype) = 32 - ;; 2-syntax-aux.watsup:61.1-61.20 - def size(I64_valtype) = 64 - ;; 2-syntax-aux.watsup:62.1-62.20 - def size(F32_valtype) = 32 - ;; 2-syntax-aux.watsup:63.1-63.20 - def size(F64_valtype) = 64 ;; 2-syntax-aux.watsup:64.1-64.22 def size(V128_valtype) = 128 + ;; 2-syntax-aux.watsup:63.1-63.20 + def size(F64_valtype) = 64 + ;; 2-syntax-aux.watsup:62.1-62.20 + def size(F32_valtype) = 32 + ;; 2-syntax-aux.watsup:61.1-61.20 + def size(I64_valtype) = 64 + ;; 2-syntax-aux.watsup:60.1-60.20 + def size(I32_valtype) = 32 ;; 2-syntax-aux.watsup:66.1-66.50 def packedsize : packedtype -> nat - ;; 2-syntax-aux.watsup:67.1-67.24 - def packedsize(I8_packedtype) = 8 ;; 2-syntax-aux.watsup:68.1-68.26 def packedsize(I16_packedtype) = 16 + ;; 2-syntax-aux.watsup:67.1-67.24 + def packedsize(I8_packedtype) = 8 ;; 2-syntax-aux.watsup:70.1-70.52 def storagesize : storagetype -> nat - ;; 2-syntax-aux.watsup:71.1-71.43 - def {valtype : valtype} storagesize($storagetype_valtype(valtype)) = $size(valtype) ;; 2-syntax-aux.watsup:72.1-72.55 def {packedtype : packedtype} storagesize($storagetype_packedtype(packedtype)) = $packedsize(packedtype) + ;; 2-syntax-aux.watsup:71.1-71.43 + def {valtype : valtype} storagesize($storagetype_valtype(valtype)) = $size(valtype) ;; 2-syntax-aux.watsup:77.1-77.62 def unpacktype : storagetype -> valtype - ;; 2-syntax-aux.watsup:78.1-78.35 - def {valtype : valtype} unpacktype($storagetype_valtype(valtype)) = valtype ;; 2-syntax-aux.watsup:79.1-79.34 def {packedtype : packedtype} unpacktype($storagetype_packedtype(packedtype)) = I32_valtype + ;; 2-syntax-aux.watsup:78.1-78.35 + def {valtype : valtype} unpacktype($storagetype_valtype(valtype)) = valtype ;; 2-syntax-aux.watsup:81.1-81.65 def unpacknumtype : storagetype -> numtype - ;; 2-syntax-aux.watsup:82.1-82.38 - def {numtype : numtype} unpacknumtype($storagetype_numtype(numtype)) = numtype ;; 2-syntax-aux.watsup:83.1-83.37 def {packedtype : packedtype} unpacknumtype($storagetype_packedtype(packedtype)) = I32_numtype + ;; 2-syntax-aux.watsup:82.1-82.38 + def {numtype : numtype} unpacknumtype($storagetype_numtype(numtype)) = numtype ;; 2-syntax-aux.watsup:85.1-85.51 def sxfield : storagetype -> sx? - ;; 2-syntax-aux.watsup:86.1-86.28 - def {valtype : valtype} sxfield($storagetype_valtype(valtype)) = ?() ;; 2-syntax-aux.watsup:87.1-87.29 def {packedtype : packedtype} sxfield($storagetype_packedtype(packedtype)) = ?(S_sx) + ;; 2-syntax-aux.watsup:86.1-86.28 + def {valtype : valtype} sxfield($storagetype_valtype(valtype)) = ?() ;; 2-syntax-aux.watsup:92.1-92.59 def diffrt : (reftype, reftype) -> reftype - ;; 2-syntax-aux.watsup:94.1-94.64 - def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) = REF_reftype(`NULL%?`(?()), ht_1) ;; 2-syntax-aux.watsup:95.1-95.65 def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?()), ht_2)) = REF_reftype(nul_1, ht_1) + ;; 2-syntax-aux.watsup:94.1-94.64 + def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) = REF_reftype(`NULL%?`(?()), ht_1) ;; 2-syntax-aux.watsup:100.1-100.42 syntax typevar = @@ -4749,14 +4892,14 @@ rec { ;; 2-syntax-aux.watsup:109.1-109.92 def subst_typevar : (typevar, typevar*, heaptype*) -> heaptype - ;; 2-syntax-aux.watsup:134.1-134.38 - def {xx : typevar} subst_typevar(xx, [], []) = $heaptype_typevar(xx) - ;; 2-syntax-aux.watsup:135.1-135.95 - def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 - -- if (xx = xx_1) ;; 2-syntax-aux.watsup:136.1-136.92 def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = $subst_typevar(xx, xx'*{xx'}, ht'*{ht'}) -- otherwise + ;; 2-syntax-aux.watsup:135.1-135.95 + def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 + -- if (xx = xx_1) + ;; 2-syntax-aux.watsup:134.1-134.38 + def {xx : typevar} subst_typevar(xx, [], []) = $heaptype_typevar(xx) } ;; 2-syntax-aux.watsup:111.1-111.92 @@ -4779,13 +4922,13 @@ rec { ;; 2-syntax-aux.watsup:113.1-113.92 def subst_heaptype : (heaptype, typevar*, heaptype*) -> heaptype - ;; 2-syntax-aux.watsup:141.1-141.67 - def {ht* : heaptype*, xx* : typevar*, xx' : typevar} subst_heaptype($heaptype_typevar(xx'), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) - ;; 2-syntax-aux.watsup:142.1-142.65 - def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_heaptype($heaptype_deftype(dt), xx*{xx}, ht*{ht}) = $heaptype_deftype($subst_deftype(dt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:143.1-143.55 def {ht* : heaptype*, ht' : heaptype, xx* : typevar*} subst_heaptype(ht', xx*{xx}, ht*{ht}) = ht' -- otherwise + ;; 2-syntax-aux.watsup:142.1-142.65 + def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_heaptype($heaptype_deftype(dt), xx*{xx}, ht*{ht}) = $heaptype_deftype($subst_deftype(dt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:141.1-141.67 + def {ht* : heaptype*, xx* : typevar*, xx' : typevar} subst_heaptype($heaptype_typevar(xx'), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) ;; 2-syntax-aux.watsup:114.1-114.92 def subst_reftype : (reftype, typevar*, heaptype*) -> reftype @@ -4794,21 +4937,21 @@ def subst_reftype : (reftype, typevar*, heaptype*) -> reftype ;; 2-syntax-aux.watsup:115.1-115.92 def subst_valtype : (valtype, typevar*, heaptype*) -> valtype - ;; 2-syntax-aux.watsup:147.1-147.64 - def {ht* : heaptype*, nt : numtype, xx* : typevar*} subst_valtype($valtype_numtype(nt), xx*{xx}, ht*{ht}) = $valtype_numtype($subst_numtype(nt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:148.1-148.64 - def {ht* : heaptype*, vt : vectype, xx* : typevar*} subst_valtype($valtype_vectype(vt), xx*{xx}, ht*{ht}) = $valtype_vectype($subst_vectype(vt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:149.1-149.64 - def {ht* : heaptype*, rt : reftype, xx* : typevar*} subst_valtype($valtype_reftype(rt), xx*{xx}, ht*{ht}) = $valtype_reftype($subst_reftype(rt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:150.1-150.40 def {ht* : heaptype*, xx* : typevar*} subst_valtype(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + ;; 2-syntax-aux.watsup:149.1-149.64 + def {ht* : heaptype*, rt : reftype, xx* : typevar*} subst_valtype($valtype_reftype(rt), xx*{xx}, ht*{ht}) = $valtype_reftype($subst_reftype(rt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:148.1-148.64 + def {ht* : heaptype*, vt : vectype, xx* : typevar*} subst_valtype($valtype_vectype(vt), xx*{xx}, ht*{ht}) = $valtype_vectype($subst_vectype(vt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:147.1-147.64 + def {ht* : heaptype*, nt : numtype, xx* : typevar*} subst_valtype($valtype_numtype(nt), xx*{xx}, ht*{ht}) = $valtype_numtype($subst_numtype(nt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:118.1-118.92 def subst_storagetype : (storagetype, typevar*, heaptype*) -> storagetype - ;; 2-syntax-aux.watsup:154.1-154.66 - def {ht* : heaptype*, t : valtype, xx* : typevar*} subst_storagetype($storagetype_valtype(t), xx*{xx}, ht*{ht}) = $storagetype_valtype($subst_valtype(t, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:155.1-155.71 def {ht* : heaptype*, pt : packedtype, xx* : typevar*} subst_storagetype($storagetype_packedtype(pt), xx*{xx}, ht*{ht}) = $storagetype_packedtype($subst_packedtype(pt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:154.1-154.66 + def {ht* : heaptype*, t : valtype, xx* : typevar*} subst_storagetype($storagetype_valtype(t), xx*{xx}, ht*{ht}) = $storagetype_valtype($subst_valtype(t, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:119.1-119.92 def subst_fieldtype : (fieldtype, typevar*, heaptype*) -> fieldtype @@ -4817,19 +4960,19 @@ def subst_fieldtype : (fieldtype, typevar*, heaptype*) -> fieldtype ;; 2-syntax-aux.watsup:121.1-121.92 def subst_comptype : (comptype, typevar*, heaptype*) -> comptype - ;; 2-syntax-aux.watsup:159.1-159.85 - def {ht* : heaptype*, xx* : typevar*, yt* : fieldtype*} subst_comptype(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) - ;; 2-syntax-aux.watsup:160.1-160.81 - def {ht* : heaptype*, xx* : typevar*, yt : fieldtype} subst_comptype(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:161.1-161.78 def {ft : functype, ht* : heaptype*, xx* : typevar*} subst_comptype(FUNC_comptype(ft), xx*{xx}, ht*{ht}) = FUNC_comptype($subst_functype(ft, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:160.1-160.81 + def {ht* : heaptype*, xx* : typevar*, yt : fieldtype} subst_comptype(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:159.1-159.85 + def {ht* : heaptype*, xx* : typevar*, yt* : fieldtype*} subst_comptype(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) ;; 2-syntax-aux.watsup:122.1-122.92 def subst_subtype : (subtype, typevar*, heaptype*) -> subtype - ;; 2-syntax-aux.watsup:163.1-164.76 - def {ct : comptype, fin : fin, ht* : heaptype*, xx* : typevar*, y* : idx*} subst_subtype(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:165.1-166.73 def {ct : comptype, fin : fin, ht* : heaptype*, ht'* : heaptype*, xx* : typevar*} subst_subtype(SUBD_subtype(fin, ht'*{ht'}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx}, ht*{ht})*{ht'}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:163.1-164.76 + def {ct : comptype, fin : fin, ht* : heaptype*, xx* : typevar*, y* : idx*} subst_subtype(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:123.1-123.92 def subst_rectype : (rectype, typevar*, heaptype*) -> rectype @@ -4864,14 +5007,14 @@ def subst_memtype : (memtype, typevar*, heaptype*) -> memtype ;; 2-syntax-aux.watsup:131.1-131.92 def subst_externtype : (externtype, typevar*, heaptype*) -> externtype - ;; 2-syntax-aux.watsup:177.1-177.79 - def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_externtype(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:178.1-178.86 - def {gt : globaltype, ht* : heaptype*, xx* : typevar*} subst_externtype(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:179.1-179.83 - def {ht* : heaptype*, tt : tabletype, xx* : typevar*} subst_externtype(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:180.1-180.77 def {ht* : heaptype*, mt : memtype, xx* : typevar*} subst_externtype(MEM_externtype(mt), xx*{xx}, ht*{ht}) = MEM_externtype($subst_memtype(mt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:179.1-179.83 + def {ht* : heaptype*, tt : tabletype, xx* : typevar*} subst_externtype(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:178.1-178.86 + def {gt : globaltype, ht* : heaptype*, xx* : typevar*} subst_externtype(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:177.1-177.79 + def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_externtype(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:183.1-183.74 def subst_all_reftype : (reftype, heaptype*) -> reftype @@ -4888,10 +5031,10 @@ rec { ;; 2-syntax-aux.watsup:189.1-189.77 def subst_all_deftypes : (deftype*, heaptype*) -> deftype* - ;; 2-syntax-aux.watsup:191.1-191.40 - def {ht* : heaptype*} subst_all_deftypes([], ht*{ht}) = [] ;; 2-syntax-aux.watsup:192.1-192.101 def {dt* : deftype*, dt_1 : deftype, ht* : heaptype*} subst_all_deftypes([dt_1] :: dt*{dt}, ht*{ht}) = [$subst_all_deftype(dt_1, ht*{ht})] :: $subst_all_deftypes(dt*{dt}, ht*{ht}) + ;; 2-syntax-aux.watsup:191.1-191.40 + def {ht* : heaptype*} subst_all_deftypes([], ht*{ht}) = [] } ;; 2-syntax-aux.watsup:197.1-197.65 @@ -4935,13 +5078,13 @@ rec { ;; 2-syntax-aux.watsup:221.1-221.64 def funcsxt : externtype* -> deftype* - ;; 2-syntax-aux.watsup:226.1-226.24 - def funcsxt([]) = [] - ;; 2-syntax-aux.watsup:227.1-227.47 - def {dt : deftype, et* : externtype*} funcsxt([FUNC_externtype(dt)] :: et*{et}) = [dt] :: $funcsxt(et*{et}) ;; 2-syntax-aux.watsup:228.1-228.59 def {et* : externtype*, externtype : externtype} funcsxt([externtype] :: et*{et}) = $funcsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:227.1-227.47 + def {dt : deftype, et* : externtype*} funcsxt([FUNC_externtype(dt)] :: et*{et}) = [dt] :: $funcsxt(et*{et}) + ;; 2-syntax-aux.watsup:226.1-226.24 + def funcsxt([]) = [] } ;; 2-syntax-aux.watsup:222.1-222.66 @@ -4949,13 +5092,13 @@ rec { ;; 2-syntax-aux.watsup:222.1-222.66 def globalsxt : externtype* -> globaltype* - ;; 2-syntax-aux.watsup:230.1-230.26 - def globalsxt([]) = [] - ;; 2-syntax-aux.watsup:231.1-231.53 - def {et* : externtype*, gt : globaltype} globalsxt([GLOBAL_externtype(gt)] :: et*{et}) = [gt] :: $globalsxt(et*{et}) ;; 2-syntax-aux.watsup:232.1-232.63 def {et* : externtype*, externtype : externtype} globalsxt([externtype] :: et*{et}) = $globalsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:231.1-231.53 + def {et* : externtype*, gt : globaltype} globalsxt([GLOBAL_externtype(gt)] :: et*{et}) = [gt] :: $globalsxt(et*{et}) + ;; 2-syntax-aux.watsup:230.1-230.26 + def globalsxt([]) = [] } ;; 2-syntax-aux.watsup:223.1-223.65 @@ -4963,13 +5106,13 @@ rec { ;; 2-syntax-aux.watsup:223.1-223.65 def tablesxt : externtype* -> tabletype* - ;; 2-syntax-aux.watsup:234.1-234.25 - def tablesxt([]) = [] - ;; 2-syntax-aux.watsup:235.1-235.50 - def {et* : externtype*, tt : tabletype} tablesxt([TABLE_externtype(tt)] :: et*{et}) = [tt] :: $tablesxt(et*{et}) ;; 2-syntax-aux.watsup:236.1-236.61 def {et* : externtype*, externtype : externtype} tablesxt([externtype] :: et*{et}) = $tablesxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:235.1-235.50 + def {et* : externtype*, tt : tabletype} tablesxt([TABLE_externtype(tt)] :: et*{et}) = [tt] :: $tablesxt(et*{et}) + ;; 2-syntax-aux.watsup:234.1-234.25 + def tablesxt([]) = [] } ;; 2-syntax-aux.watsup:224.1-224.63 @@ -4977,13 +5120,13 @@ rec { ;; 2-syntax-aux.watsup:224.1-224.63 def memsxt : externtype* -> memtype* - ;; 2-syntax-aux.watsup:238.1-238.23 - def memsxt([]) = [] - ;; 2-syntax-aux.watsup:239.1-239.44 - def {et* : externtype*, mt : memtype} memsxt([MEM_externtype(mt)] :: et*{et}) = [mt] :: $memsxt(et*{et}) ;; 2-syntax-aux.watsup:240.1-240.57 def {et* : externtype*, externtype : externtype} memsxt([externtype] :: et*{et}) = $memsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:239.1-239.44 + def {et* : externtype*, mt : memtype} memsxt([MEM_externtype(mt)] :: et*{et}) = [mt] :: $memsxt(et*{et}) + ;; 2-syntax-aux.watsup:238.1-238.23 + def memsxt([]) = [] } ;; 2-syntax-aux.watsup:249.1-249.33 @@ -4996,12 +5139,12 @@ def s33_to_u32 : s33 -> u32 ;; 3-numerics.watsup:12.1-12.57 def signed : (N, nat) -> int - ;; 3-numerics.watsup:13.1-13.54 - def {N : N, i : nat} signed(N, i) = (i <: int) - -- if (0 <= (2 ^ (N - 1))) ;; 3-numerics.watsup:14.1-14.60 def {N : N, i : nat} signed(N, i) = ((i - (2 ^ N)) <: int) -- if (((2 ^ (N - 1)) <= i) /\ (i < (2 ^ N))) + ;; 3-numerics.watsup:13.1-13.54 + def {N : N, i : nat} signed(N, i) = (i <: int) + -- if (0 <= (2 ^ (N - 1))) ;; 3-numerics.watsup:16.1-16.63 def invsigned : (N, int) -> nat @@ -5429,45 +5572,45 @@ def inst_reftype : (moduleinst, reftype) -> reftype ;; 5-runtime-aux.watsup:19.1-19.52 def default : valtype -> val? - ;; 5-runtime-aux.watsup:21.1-21.34 - def default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) - ;; 5-runtime-aux.watsup:22.1-22.34 - def default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) - ;; 5-runtime-aux.watsup:23.1-23.34 - def default(F32_valtype) = ?(CONST_val(F32_numtype, 0)) - ;; 5-runtime-aux.watsup:24.1-24.34 - def default(F64_valtype) = ?(CONST_val(F64_numtype, 0)) - ;; 5-runtime-aux.watsup:25.1-25.42 - def {ht : heaptype} default(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) ;; 5-runtime-aux.watsup:26.1-26.31 def {ht : heaptype} default(REF_valtype(`NULL%?`(?()), ht)) = ?() + ;; 5-runtime-aux.watsup:25.1-25.42 + def {ht : heaptype} default(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) + ;; 5-runtime-aux.watsup:24.1-24.34 + def default(F64_valtype) = ?(CONST_val(F64_numtype, 0)) + ;; 5-runtime-aux.watsup:23.1-23.34 + def default(F32_valtype) = ?(CONST_val(F32_numtype, 0)) + ;; 5-runtime-aux.watsup:22.1-22.34 + def default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) + ;; 5-runtime-aux.watsup:21.1-21.34 + def default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) ;; 5-runtime-aux.watsup:31.1-31.73 def packval : (storagetype, val) -> fieldval - ;; 5-runtime-aux.watsup:34.1-34.27 - def {t : valtype, val : val} packval($storagetype_valtype(t), val) = $fieldval_val(val) ;; 5-runtime-aux.watsup:35.1-35.70 def {i : nat, pt : packedtype} packval($storagetype_packedtype(pt), CONST_val(I32_numtype, i)) = PACK_fieldval(pt, $wrap(32, $packedsize(pt), i)) + ;; 5-runtime-aux.watsup:34.1-34.27 + def {t : valtype, val : val} packval($storagetype_valtype(t), val) = $fieldval_val(val) ;; 5-runtime-aux.watsup:32.1-32.83 def unpackval : (storagetype, sx?, fieldval) -> val - ;; 5-runtime-aux.watsup:37.1-37.34 - def {t : valtype, val : val} unpackval($storagetype_valtype(t), ?(), $fieldval_val(val)) = val ;; 5-runtime-aux.watsup:38.1-38.79 def {i : nat, pt : packedtype, sx : sx} unpackval($storagetype_packedtype(pt), ?(sx), PACK_fieldval(pt, i)) = CONST_val(I32_numtype, $ext($packedsize(pt), 32, sx, i)) + ;; 5-runtime-aux.watsup:37.1-37.34 + def {t : valtype, val : val} unpackval($storagetype_valtype(t), ?(), $fieldval_val(val)) = val ;; 5-runtime-aux.watsup:43.1-43.62 rec { ;; 5-runtime-aux.watsup:43.1-43.62 def funcsxv : externval* -> funcaddr* - ;; 5-runtime-aux.watsup:48.1-48.24 - def funcsxv([]) = [] - ;; 5-runtime-aux.watsup:49.1-49.47 - def {fa : funcaddr, xv* : externval*} funcsxv([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) ;; 5-runtime-aux.watsup:50.1-50.58 def {externval : externval, xv* : externval*} funcsxv([externval] :: xv*{xv}) = $funcsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:49.1-49.47 + def {fa : funcaddr, xv* : externval*} funcsxv([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:48.1-48.24 + def funcsxv([]) = [] } ;; 5-runtime-aux.watsup:44.1-44.64 @@ -5475,13 +5618,13 @@ rec { ;; 5-runtime-aux.watsup:44.1-44.64 def globalsxv : externval* -> globaladdr* - ;; 5-runtime-aux.watsup:52.1-52.26 - def globalsxv([]) = [] - ;; 5-runtime-aux.watsup:53.1-53.53 - def {ga : globaladdr, xv* : externval*} globalsxv([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) ;; 5-runtime-aux.watsup:54.1-54.62 def {externval : externval, xv* : externval*} globalsxv([externval] :: xv*{xv}) = $globalsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:53.1-53.53 + def {ga : globaladdr, xv* : externval*} globalsxv([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:52.1-52.26 + def globalsxv([]) = [] } ;; 5-runtime-aux.watsup:45.1-45.63 @@ -5489,13 +5632,13 @@ rec { ;; 5-runtime-aux.watsup:45.1-45.63 def tablesxv : externval* -> tableaddr* - ;; 5-runtime-aux.watsup:56.1-56.25 - def tablesxv([]) = [] - ;; 5-runtime-aux.watsup:57.1-57.50 - def {ta : tableaddr, xv* : externval*} tablesxv([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) ;; 5-runtime-aux.watsup:58.1-58.60 def {externval : externval, xv* : externval*} tablesxv([externval] :: xv*{xv}) = $tablesxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:57.1-57.50 + def {ta : tableaddr, xv* : externval*} tablesxv([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) + ;; 5-runtime-aux.watsup:56.1-56.25 + def tablesxv([]) = [] } ;; 5-runtime-aux.watsup:46.1-46.61 @@ -5503,13 +5646,13 @@ rec { ;; 5-runtime-aux.watsup:46.1-46.61 def memsxv : externval* -> memaddr* - ;; 5-runtime-aux.watsup:60.1-60.23 - def memsxv([]) = [] - ;; 5-runtime-aux.watsup:61.1-61.44 - def {ma : memaddr, xv* : externval*} memsxv([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) ;; 5-runtime-aux.watsup:62.1-62.56 def {externval : externval, xv* : externval*} memsxv([externval] :: xv*{xv}) = $memsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:61.1-61.44 + def {ma : memaddr, xv* : externval*} memsxv([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:60.1-60.23 + def memsxv([]) = [] } ;; 5-runtime-aux.watsup:72.1-72.57 @@ -5709,10 +5852,10 @@ rec { ;; 6-typing.watsup:26.1-26.86 def with_locals : (context, localidx*, localtype*) -> context - ;; 6-typing.watsup:28.1-28.34 - def {C : context} with_locals(C, [], []) = C ;; 6-typing.watsup:29.1-29.85 def {C : context, lt* : localtype*, lt_1 : localtype, x* : idx*, x_1 : idx} with_locals(C, [x_1] :: x*{x}, [lt_1] :: lt*{lt}) = $with_locals(C[LOCAL_context[x_1] = lt_1], x*{x}, lt*{lt}) + ;; 6-typing.watsup:28.1-28.34 + def {C : context} with_locals(C, [], []) = C } ;; 6-typing.watsup:33.1-33.65 @@ -5720,11 +5863,11 @@ rec { ;; 6-typing.watsup:33.1-33.65 def clostypes : deftype* -> deftype* - ;; 6-typing.watsup:37.1-37.26 - def clostypes([]) = [] ;; 6-typing.watsup:38.1-38.93 def {dt* : deftype*, dt'* : deftype*, dt_N : deftype} clostypes(dt*{dt} :: [dt_N]) = dt'*{dt'} :: [$subst_all_deftype(dt_N, $heaptype_deftype(dt')*{dt'})] -- if (dt'*{dt'} = $clostypes(dt*{dt})) + ;; 6-typing.watsup:37.1-37.26 + def clostypes([]) = [] } ;; 6-typing.watsup:32.1-32.65 @@ -5747,19 +5890,19 @@ relation Vectype_ok: `%|-%:OK`(context, vectype) ;; 6-typing.watsup:49.1-49.72 relation Heaptype_ok: `%|-%:OK`(context, heaptype) - ;; 6-typing.watsup:60.1-61.24 - rule abs {C : context, absheaptype : absheaptype}: - `%|-%:OK`(C, $heaptype_absheaptype(absheaptype)) + ;; 6-typing.watsup:67.1-69.22 + rule rec {C : context, i : nat, st : subtype}: + `%|-%:OK`(C, REC_heaptype(i)) + -- if (C.REC_context[i] = st) ;; 6-typing.watsup:63.1-65.23 rule typeidx {C : context, dt : deftype, x : idx}: `%|-%:OK`(C, _IDX_heaptype(x)) -- if (C.TYPE_context[x] = dt) - ;; 6-typing.watsup:67.1-69.22 - rule rec {C : context, i : nat, st : subtype}: - `%|-%:OK`(C, REC_heaptype(i)) - -- if (C.REC_context[i] = st) + ;; 6-typing.watsup:60.1-61.24 + rule abs {C : context, absheaptype : absheaptype}: + `%|-%:OK`(C, $heaptype_absheaptype(absheaptype)) ;; 6-typing.watsup:50.1-50.71 relation Reftype_ok: `%|-%:OK`(context, reftype) @@ -5770,24 +5913,24 @@ relation Reftype_ok: `%|-%:OK`(context, reftype) ;; 6-typing.watsup:51.1-51.71 relation Valtype_ok: `%|-%:OK`(context, valtype) - ;; 6-typing.watsup:75.1-77.35 - rule num {C : context, numtype : numtype}: - `%|-%:OK`(C, $valtype_numtype(numtype)) - -- Numtype_ok: `%|-%:OK`(C, numtype) - - ;; 6-typing.watsup:79.1-81.35 - rule vec {C : context, vectype : vectype}: - `%|-%:OK`(C, $valtype_vectype(vectype)) - -- Vectype_ok: `%|-%:OK`(C, vectype) + ;; 6-typing.watsup:87.1-88.16 + rule bot {C : context}: + `%|-%:OK`(C, BOT_valtype) ;; 6-typing.watsup:83.1-85.35 rule ref {C : context, reftype : reftype}: `%|-%:OK`(C, $valtype_reftype(reftype)) -- Reftype_ok: `%|-%:OK`(C, reftype) - ;; 6-typing.watsup:87.1-88.16 - rule bot {C : context}: - `%|-%:OK`(C, BOT_valtype) + ;; 6-typing.watsup:79.1-81.35 + rule vec {C : context, vectype : vectype}: + `%|-%:OK`(C, $valtype_vectype(vectype)) + -- Vectype_ok: `%|-%:OK`(C, vectype) + + ;; 6-typing.watsup:75.1-77.35 + rule num {C : context, numtype : numtype}: + `%|-%:OK`(C, $valtype_numtype(numtype)) + -- Numtype_ok: `%|-%:OK`(C, numtype) ;; 6-typing.watsup:93.1-93.74 relation Resulttype_ok: `%|-%:OK`(context, resulttype) @@ -5821,16 +5964,16 @@ relation Packedtype_ok: `%|-%:OK`(context, packedtype) ;; 6-typing.watsup:114.1-114.77 relation Storagetype_ok: `%|-%:OK`(context, storagetype) - ;; 6-typing.watsup:131.1-133.35 - rule val {C : context, valtype : valtype}: - `%|-%:OK`(C, $storagetype_valtype(valtype)) - -- Valtype_ok: `%|-%:OK`(C, valtype) - ;; 6-typing.watsup:135.1-137.41 rule packed {C : context, packedtype : packedtype}: `%|-%:OK`(C, $storagetype_packedtype(packedtype)) -- Packedtype_ok: `%|-%:OK`(C, packedtype) + ;; 6-typing.watsup:131.1-133.35 + rule val {C : context, valtype : valtype}: + `%|-%:OK`(C, $storagetype_valtype(valtype)) + -- Valtype_ok: `%|-%:OK`(C, valtype) + ;; 6-typing.watsup:113.1-113.75 relation Fieldtype_ok: `%|-%:OK`(context, fieldtype) ;; 6-typing.watsup:139.1-141.34 @@ -5848,20 +5991,20 @@ relation Functype_ok: `%|-%:OK`(context, functype) ;; 6-typing.watsup:115.1-115.74 relation Comptype_ok: `%|-%:OK`(context, comptype) - ;; 6-typing.watsup:144.1-146.35 - rule struct {C : context, yt* : fieldtype*}: - `%|-%:OK`(C, STRUCT_comptype(yt*{yt})) - -- (Fieldtype_ok: `%|-%:OK`(C, yt))*{yt} + ;; 6-typing.watsup:152.1-154.31 + rule func {C : context, ft : functype}: + `%|-%:OK`(C, FUNC_comptype(ft)) + -- Functype_ok: `%|-%:OK`(C, ft) ;; 6-typing.watsup:148.1-150.32 rule array {C : context, yt : fieldtype}: `%|-%:OK`(C, ARRAY_comptype(yt)) -- Fieldtype_ok: `%|-%:OK`(C, yt) - ;; 6-typing.watsup:152.1-154.31 - rule func {C : context, ft : functype}: - `%|-%:OK`(C, FUNC_comptype(ft)) - -- Functype_ok: `%|-%:OK`(C, ft) + ;; 6-typing.watsup:144.1-146.35 + rule struct {C : context, yt* : fieldtype*}: + `%|-%:OK`(C, STRUCT_comptype(yt*{yt})) + -- (Fieldtype_ok: `%|-%:OK`(C, yt))*{yt} ;; 6-typing.watsup:391.1-391.91 relation Packedtype_sub: `%|-%<:%`(context, packedtype, packedtype) @@ -5880,113 +6023,113 @@ rec { ;; 6-typing.watsup:125.1-125.75 relation Deftype_sub: `%|-%<:%`(context, deftype, deftype) - ;; 6-typing.watsup:434.1-436.58 - rule refl {C : context, deftype_1 : deftype, deftype_2 : deftype}: - `%|-%<:%`(C, deftype_1, deftype_2) - -- if ($clostype(C, deftype_1) = $clostype(C, deftype_2)) - ;; 6-typing.watsup:438.1-441.40 rule super {C : context, ct : comptype, deftype_1 : deftype, deftype_2 : deftype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*}: `%|-%<:%`(C, deftype_1, deftype_2) -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) -- Heaptype_sub: `%|-%<:%`(C, ht, $heaptype_deftype(deftype_2)) + ;; 6-typing.watsup:434.1-436.58 + rule refl {C : context, deftype_1 : deftype, deftype_2 : deftype}: + `%|-%<:%`(C, deftype_1, deftype_2) + -- if ($clostype(C, deftype_1) = $clostype(C, deftype_2)) + ;; 6-typing.watsup:271.1-271.79 relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) - ;; 6-typing.watsup:282.1-283.28 - rule refl {C : context, heaptype : heaptype}: - `%|-%<:%`(C, heaptype, heaptype) + ;; 6-typing.watsup:343.1-344.23 + rule bot {C : context, heaptype : heaptype}: + `%|-%<:%`(C, BOT_heaptype, heaptype) - ;; 6-typing.watsup:285.1-289.48 - rule trans {C : context, heaptype' : heaptype, heaptype_1 : heaptype, heaptype_2 : heaptype}: - `%|-%<:%`(C, heaptype_1, heaptype_2) - -- Heaptype_ok: `%|-%:OK`(C, heaptype') - -- Heaptype_sub: `%|-%<:%`(C, heaptype_1, heaptype') - -- Heaptype_sub: `%|-%<:%`(C, heaptype', heaptype_2) + ;; 6-typing.watsup:339.1-341.43 + rule noextern {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NOEXTERN_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, EXTERN_heaptype) - ;; 6-typing.watsup:291.1-292.17 - rule eq-any {C : context}: - `%|-%<:%`(C, EQ_heaptype, ANY_heaptype) + ;; 6-typing.watsup:335.1-337.41 + rule nofunc {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NOFUNC_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, FUNC_heaptype) - ;; 6-typing.watsup:294.1-295.17 - rule i31-eq {C : context}: - `%|-%<:%`(C, I31_heaptype, EQ_heaptype) + ;; 6-typing.watsup:331.1-333.40 + rule none {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NONE_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, ANY_heaptype) - ;; 6-typing.watsup:297.1-298.20 - rule struct-eq {C : context}: - `%|-%<:%`(C, STRUCT_heaptype, EQ_heaptype) + ;; 6-typing.watsup:327.1-329.48 + rule rec {C : context, ct : comptype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*, i : nat}: + `%|-%<:%`(C, REC_heaptype(i), ht) + -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) - ;; 6-typing.watsup:300.1-301.19 - rule array-eq {C : context}: - `%|-%<:%`(C, ARRAY_heaptype, EQ_heaptype) + ;; 6-typing.watsup:323.1-325.52 + rule typeidx-r {C : context, heaptype : heaptype, typeidx : typeidx}: + `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, $heaptype_deftype(C.TYPE_context[typeidx])) - ;; 6-typing.watsup:303.1-305.35 - rule struct {C : context, deftype : deftype, yt* : fieldtype*}: - `%|-%<:%`(C, $heaptype_deftype(deftype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) + ;; 6-typing.watsup:319.1-321.52 + rule typeidx-l {C : context, heaptype : heaptype, typeidx : typeidx}: + `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) + -- Heaptype_sub: `%|-%<:%`(C, $heaptype_deftype(C.TYPE_context[typeidx]), heaptype) - ;; 6-typing.watsup:307.1-309.33 - rule array {C : context, deftype : deftype, yt : fieldtype}: - `%|-%<:%`(C, $heaptype_deftype(deftype), ARRAY_heaptype) - -- Expand: `%~~%`(deftype, ARRAY_comptype(yt)) + ;; 6-typing.watsup:315.1-317.46 + rule def {C : context, deftype_1 : deftype, deftype_2 : deftype}: + `%|-%<:%`(C, $heaptype_deftype(deftype_1), $heaptype_deftype(deftype_2)) + -- Deftype_sub: `%|-%<:%`(C, deftype_1, deftype_2) ;; 6-typing.watsup:311.1-313.32 rule func {C : context, deftype : deftype, ft : functype}: `%|-%<:%`(C, $heaptype_deftype(deftype), FUNC_heaptype) -- Expand: `%~~%`(deftype, FUNC_comptype(ft)) - ;; 6-typing.watsup:315.1-317.46 - rule def {C : context, deftype_1 : deftype, deftype_2 : deftype}: - `%|-%<:%`(C, $heaptype_deftype(deftype_1), $heaptype_deftype(deftype_2)) - -- Deftype_sub: `%|-%<:%`(C, deftype_1, deftype_2) + ;; 6-typing.watsup:307.1-309.33 + rule array {C : context, deftype : deftype, yt : fieldtype}: + `%|-%<:%`(C, $heaptype_deftype(deftype), ARRAY_heaptype) + -- Expand: `%~~%`(deftype, ARRAY_comptype(yt)) - ;; 6-typing.watsup:319.1-321.52 - rule typeidx-l {C : context, heaptype : heaptype, typeidx : typeidx}: - `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) - -- Heaptype_sub: `%|-%<:%`(C, $heaptype_deftype(C.TYPE_context[typeidx]), heaptype) + ;; 6-typing.watsup:303.1-305.35 + rule struct {C : context, deftype : deftype, yt* : fieldtype*}: + `%|-%<:%`(C, $heaptype_deftype(deftype), STRUCT_heaptype) + -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) - ;; 6-typing.watsup:323.1-325.52 - rule typeidx-r {C : context, heaptype : heaptype, typeidx : typeidx}: - `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, $heaptype_deftype(C.TYPE_context[typeidx])) + ;; 6-typing.watsup:300.1-301.19 + rule array-eq {C : context}: + `%|-%<:%`(C, ARRAY_heaptype, EQ_heaptype) - ;; 6-typing.watsup:327.1-329.48 - rule rec {C : context, ct : comptype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*, i : nat}: - `%|-%<:%`(C, REC_heaptype(i), ht) - -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + ;; 6-typing.watsup:297.1-298.20 + rule struct-eq {C : context}: + `%|-%<:%`(C, STRUCT_heaptype, EQ_heaptype) - ;; 6-typing.watsup:331.1-333.40 - rule none {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NONE_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, ANY_heaptype) + ;; 6-typing.watsup:294.1-295.17 + rule i31-eq {C : context}: + `%|-%<:%`(C, I31_heaptype, EQ_heaptype) - ;; 6-typing.watsup:335.1-337.41 - rule nofunc {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NOFUNC_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, FUNC_heaptype) + ;; 6-typing.watsup:291.1-292.17 + rule eq-any {C : context}: + `%|-%<:%`(C, EQ_heaptype, ANY_heaptype) - ;; 6-typing.watsup:339.1-341.43 - rule noextern {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NOEXTERN_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, EXTERN_heaptype) + ;; 6-typing.watsup:285.1-289.48 + rule trans {C : context, heaptype' : heaptype, heaptype_1 : heaptype, heaptype_2 : heaptype}: + `%|-%<:%`(C, heaptype_1, heaptype_2) + -- Heaptype_ok: `%|-%:OK`(C, heaptype') + -- Heaptype_sub: `%|-%<:%`(C, heaptype_1, heaptype') + -- Heaptype_sub: `%|-%<:%`(C, heaptype', heaptype_2) - ;; 6-typing.watsup:343.1-344.23 - rule bot {C : context, heaptype : heaptype}: - `%|-%<:%`(C, BOT_heaptype, heaptype) + ;; 6-typing.watsup:282.1-283.28 + rule refl {C : context, heaptype : heaptype}: + `%|-%<:%`(C, heaptype, heaptype) } ;; 6-typing.watsup:272.1-272.78 relation Reftype_sub: `%|-%<:%`(context, reftype, reftype) - ;; 6-typing.watsup:347.1-349.37 - rule nonnull {C : context, ht_1 : heaptype, ht_2 : heaptype}: - `%|-%<:%`(C, REF_reftype(`NULL%?`(?()), ht_1), REF_reftype(`NULL%?`(?()), ht_2)) - -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) - ;; 6-typing.watsup:351.1-353.37 rule null {C : context, ht_1 : heaptype, ht_2 : heaptype}: `%|-%<:%`(C, REF_reftype(`NULL%?`(()?{}), ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) + ;; 6-typing.watsup:347.1-349.37 + rule nonnull {C : context, ht_1 : heaptype, ht_2 : heaptype}: + `%|-%<:%`(C, REF_reftype(`NULL%?`(?()), ht_1), REF_reftype(`NULL%?`(?()), ht_2)) + -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) + ;; 6-typing.watsup:270.1-270.78 relation Vectype_sub: `%|-%<:%`(context, vectype, vectype) ;; 6-typing.watsup:278.1-279.26 @@ -5995,50 +6138,50 @@ relation Vectype_sub: `%|-%<:%`(context, vectype, vectype) ;; 6-typing.watsup:273.1-273.78 relation Valtype_sub: `%|-%<:%`(context, valtype, valtype) - ;; 6-typing.watsup:356.1-358.46 - rule num {C : context, numtype_1 : numtype, numtype_2 : numtype}: - `%|-%<:%`(C, $valtype_numtype(numtype_1), $valtype_numtype(numtype_2)) - -- Numtype_sub: `%|-%<:%`(C, numtype_1, numtype_2) - - ;; 6-typing.watsup:360.1-362.46 - rule vec {C : context, vectype_1 : vectype, vectype_2 : vectype}: - `%|-%<:%`(C, $valtype_vectype(vectype_1), $valtype_vectype(vectype_2)) - -- Vectype_sub: `%|-%<:%`(C, vectype_1, vectype_2) + ;; 6-typing.watsup:368.1-369.22 + rule bot {C : context, valtype : valtype}: + `%|-%<:%`(C, BOT_valtype, valtype) ;; 6-typing.watsup:364.1-366.46 rule ref {C : context, reftype_1 : reftype, reftype_2 : reftype}: `%|-%<:%`(C, $valtype_reftype(reftype_1), $valtype_reftype(reftype_2)) -- Reftype_sub: `%|-%<:%`(C, reftype_1, reftype_2) - ;; 6-typing.watsup:368.1-369.22 - rule bot {C : context, valtype : valtype}: - `%|-%<:%`(C, BOT_valtype, valtype) + ;; 6-typing.watsup:360.1-362.46 + rule vec {C : context, vectype_1 : vectype, vectype_2 : vectype}: + `%|-%<:%`(C, $valtype_vectype(vectype_1), $valtype_vectype(vectype_2)) + -- Vectype_sub: `%|-%<:%`(C, vectype_1, vectype_2) + + ;; 6-typing.watsup:356.1-358.46 + rule num {C : context, numtype_1 : numtype, numtype_2 : numtype}: + `%|-%<:%`(C, $valtype_numtype(numtype_1), $valtype_numtype(numtype_2)) + -- Numtype_sub: `%|-%<:%`(C, numtype_1, numtype_2) ;; 6-typing.watsup:392.1-392.92 relation Storagetype_sub: `%|-%<:%`(context, storagetype, storagetype) - ;; 6-typing.watsup:402.1-404.46 - rule val {C : context, valtype_1 : valtype, valtype_2 : valtype}: - `%|-%<:%`(C, $storagetype_valtype(valtype_1), $storagetype_valtype(valtype_2)) - -- Valtype_sub: `%|-%<:%`(C, valtype_1, valtype_2) - ;; 6-typing.watsup:406.1-408.55 rule packed {C : context, packedtype_1 : packedtype, packedtype_2 : packedtype}: `%|-%<:%`(C, $storagetype_packedtype(packedtype_1), $storagetype_packedtype(packedtype_2)) -- Packedtype_sub: `%|-%<:%`(C, packedtype_1, packedtype_2) + ;; 6-typing.watsup:402.1-404.46 + rule val {C : context, valtype_1 : valtype, valtype_2 : valtype}: + `%|-%<:%`(C, $storagetype_valtype(valtype_1), $storagetype_valtype(valtype_2)) + -- Valtype_sub: `%|-%<:%`(C, valtype_1, valtype_2) + ;; 6-typing.watsup:393.1-393.90 relation Fieldtype_sub: `%|-%<:%`(context, fieldtype, fieldtype) - ;; 6-typing.watsup:411.1-413.40 - rule const {C : context, zt_1 : storagetype, zt_2 : storagetype}: - `%|-%<:%`(C, `%%`(`MUT%?`(?()), zt_1), `%%`(`MUT%?`(?()), zt_2)) - -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) - ;; 6-typing.watsup:415.1-418.40 rule var {C : context, zt_1 : storagetype, zt_2 : storagetype}: `%|-%<:%`(C, `%%`(`MUT%?`(?(())), zt_1), `%%`(`MUT%?`(?(())), zt_2)) -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) + ;; 6-typing.watsup:411.1-413.40 + rule const {C : context, zt_1 : storagetype, zt_2 : storagetype}: + `%|-%<:%`(C, `%%`(`MUT%?`(?()), zt_1), `%%`(`MUT%?`(?()), zt_2)) + -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) + ;; 6-typing.watsup:395.1-395.89 relation Functype_sub: `%|-%<:%`(context, functype, functype) ;; 6-typing.watsup:458.1-459.16 @@ -6047,20 +6190,20 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) ;; 6-typing.watsup:124.1-124.76 relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) - ;; 6-typing.watsup:421.1-423.41 - rule struct {C : context, yt'_1 : fieldtype, yt_1* : fieldtype*, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) - -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} + ;; 6-typing.watsup:429.1-431.37 + rule func {C : context, ft_1 : functype, ft_2 : functype}: + `%|-%<:%`(C, FUNC_comptype(ft_1), FUNC_comptype(ft_2)) + -- Functype_sub: `%|-%<:%`(C, ft_1, ft_2) ;; 6-typing.watsup:425.1-427.38 rule array {C : context, yt_1 : fieldtype, yt_2 : fieldtype}: `%|-%<:%`(C, ARRAY_comptype(yt_1), ARRAY_comptype(yt_2)) -- Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2) - ;; 6-typing.watsup:429.1-431.37 - rule func {C : context, ft_1 : functype, ft_2 : functype}: - `%|-%<:%`(C, FUNC_comptype(ft_1), FUNC_comptype(ft_2)) - -- Functype_sub: `%|-%<:%`(C, ft_1, ft_2) + ;; 6-typing.watsup:421.1-423.41 + rule struct {C : context, yt'_1 : fieldtype, yt_1* : fieldtype*, yt_2* : fieldtype*}: + `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) + -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} ;; 6-typing.watsup:117.1-117.73 relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) @@ -6075,21 +6218,21 @@ relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) ;; 6-typing.watsup:165.1-165.65 def before : (heaptype, typeidx, nat) -> bool - ;; 6-typing.watsup:166.1-166.34 - def {deftype : deftype, i : nat, x : idx} before($heaptype_deftype(deftype), x, i) = true - ;; 6-typing.watsup:167.1-167.46 - def {i : nat, typeidx : typeidx, x : idx} before(_IDX_heaptype(typeidx), x, i) = (typeidx < x) ;; 6-typing.watsup:168.1-168.33 def {i : nat, j : nat, x : idx} before(REC_heaptype(j), x, i) = (j < i) + ;; 6-typing.watsup:167.1-167.46 + def {i : nat, typeidx : typeidx, x : idx} before(_IDX_heaptype(typeidx), x, i) = (typeidx < x) + ;; 6-typing.watsup:166.1-166.34 + def {deftype : deftype, i : nat, x : idx} before($heaptype_deftype(deftype), x, i) = true ;; 6-typing.watsup:170.1-170.69 def unrollht : (context, heaptype) -> subtype - ;; 6-typing.watsup:171.1-171.47 - def {C : context, deftype : deftype} unrollht(C, $heaptype_deftype(deftype)) = $unrolldt(deftype) - ;; 6-typing.watsup:172.1-172.60 - def {C : context, typeidx : typeidx} unrollht(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx]) ;; 6-typing.watsup:173.1-173.35 def {C : context, i : nat} unrollht(C, REC_heaptype(i)) = C.REC_context[i] + ;; 6-typing.watsup:172.1-172.60 + def {C : context, typeidx : typeidx} unrollht(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx]) + ;; 6-typing.watsup:171.1-171.47 + def {C : context, deftype : deftype} unrollht(C, $heaptype_deftype(deftype)) = $unrolldt(deftype) ;; 6-typing.watsup:119.1-119.76 relation Subtype_ok2: `%|-%:%`(context, subtype, oktypeidxnat) @@ -6107,15 +6250,15 @@ rec { ;; 6-typing.watsup:120.1-120.76 relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) - ;; 6-typing.watsup:196.1-197.24 - rule empty {C : context, i : nat, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) - ;; 6-typing.watsup:199.1-202.50 rule cons {C : context, i : nat, st* : subtype*, st_1 : subtype, x : idx}: `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidxnat((x + 1), (i + 1))) + + ;; 6-typing.watsup:196.1-197.24 + rule empty {C : context, i : nat, x : idx}: + `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) } ;; 6-typing.watsup:118.1-118.74 @@ -6123,9 +6266,10 @@ rec { ;; 6-typing.watsup:118.1-118.74 relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) - ;; 6-typing.watsup:184.1-185.23 - rule empty {C : context, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) + ;; 6-typing.watsup:192.1-194.49 + rule rec2 {C : context, st* : subtype*, x : idx}: + `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) ;; 6-typing.watsup:187.1-190.43 rule cons {C : context, st* : subtype*, st_1 : subtype, x : idx}: @@ -6133,10 +6277,9 @@ relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x + 1)) - ;; 6-typing.watsup:192.1-194.49 - rule rec2 {C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) + ;; 6-typing.watsup:184.1-185.23 + rule empty {C : context, x : idx}: + `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) } ;; 6-typing.watsup:121.1-121.73 @@ -6179,26 +6322,26 @@ relation Memtype_ok: `%|-%:OK`(context, memtype) ;; 6-typing.watsup:218.1-218.74 relation Externtype_ok: `%|-%:OK`(context, externtype) - ;; 6-typing.watsup:244.1-247.27 - rule func {C : context, dt : deftype, ft : functype}: - `%|-%:OK`(C, FUNC_externtype(dt)) - -- Deftype_ok: `%|-%:OK`(C, dt) - -- Expand: `%~~%`(dt, FUNC_comptype(ft)) - - ;; 6-typing.watsup:249.1-251.33 - rule global {C : context, gt : globaltype}: - `%|-%:OK`(C, GLOBAL_externtype(gt)) - -- Globaltype_ok: `%|-%:OK`(C, gt) + ;; 6-typing.watsup:257.1-259.30 + rule mem {C : context, mt : memtype}: + `%|-%:OK`(C, MEM_externtype(mt)) + -- Memtype_ok: `%|-%:OK`(C, mt) ;; 6-typing.watsup:253.1-255.32 rule table {C : context, tt : tabletype}: `%|-%:OK`(C, TABLE_externtype(tt)) -- Tabletype_ok: `%|-%:OK`(C, tt) - ;; 6-typing.watsup:257.1-259.30 - rule mem {C : context, mt : memtype}: - `%|-%:OK`(C, MEM_externtype(mt)) - -- Memtype_ok: `%|-%:OK`(C, mt) + ;; 6-typing.watsup:249.1-251.33 + rule global {C : context, gt : globaltype}: + `%|-%:OK`(C, GLOBAL_externtype(gt)) + -- Globaltype_ok: `%|-%:OK`(C, gt) + + ;; 6-typing.watsup:244.1-247.27 + rule func {C : context, dt : deftype, ft : functype}: + `%|-%:OK`(C, FUNC_externtype(dt)) + -- Deftype_ok: `%|-%:OK`(C, dt) + -- Expand: `%~~%`(dt, FUNC_comptype(ft)) ;; 6-typing.watsup:374.1-374.81 relation Resulttype_sub: `%|-%*<:%*`(context, valtype*, valtype*) @@ -6227,17 +6370,17 @@ relation Limits_sub: `%|-%<:%`(context, limits, limits) ;; 6-typing.watsup:447.1-447.83 relation Globaltype_sub: `%|-%<:%`(context, globaltype, globaltype) - ;; 6-typing.watsup:461.1-463.34 - rule const {C : context, t_1 : valtype, t_2 : valtype}: - `%|-%<:%`(C, `%%`(`MUT%?`(?()), t_1), `%%`(`MUT%?`(?()), t_2)) - -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) - ;; 6-typing.watsup:465.1-468.34 rule var {C : context, t_1 : valtype, t_2 : valtype}: `%|-%<:%`(C, `%%`(`MUT%?`(?(())), t_1), `%%`(`MUT%?`(?(())), t_2)) -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) -- Valtype_sub: `%|-%<:%`(C, t_2, t_1) + ;; 6-typing.watsup:461.1-463.34 + rule const {C : context, t_1 : valtype, t_2 : valtype}: + `%|-%<:%`(C, `%%`(`MUT%?`(?()), t_1), `%%`(`MUT%?`(?()), t_2)) + -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) + ;; 6-typing.watsup:448.1-448.82 relation Tabletype_sub: `%|-%<:%`(context, tabletype, tabletype) ;; 6-typing.watsup:470.1-474.36 @@ -6256,275 +6399,236 @@ relation Memtype_sub: `%|-%<:%`(context, memtype, memtype) ;; 6-typing.watsup:450.1-450.83 relation Externtype_sub: `%|-%<:%`(context, externtype, externtype) - ;; 6-typing.watsup:481.1-483.36 - rule func {C : context, dt_1 : deftype, dt_2 : deftype}: - `%|-%<:%`(C, FUNC_externtype(dt_1), FUNC_externtype(dt_2)) - -- Deftype_sub: `%|-%<:%`(C, dt_1, dt_2) - - ;; 6-typing.watsup:485.1-487.39 - rule global {C : context, gt_1 : globaltype, gt_2 : globaltype}: - `%|-%<:%`(C, GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) - -- Globaltype_sub: `%|-%<:%`(C, gt_1, gt_2) + ;; 6-typing.watsup:493.1-495.36 + rule mem {C : context, mt_1 : memtype, mt_2 : memtype}: + `%|-%<:%`(C, MEM_externtype(mt_1), MEM_externtype(mt_2)) + -- Memtype_sub: `%|-%<:%`(C, mt_1, mt_2) ;; 6-typing.watsup:489.1-491.38 rule table {C : context, tt_1 : tabletype, tt_2 : tabletype}: `%|-%<:%`(C, TABLE_externtype(tt_1), TABLE_externtype(tt_2)) -- Tabletype_sub: `%|-%<:%`(C, tt_1, tt_2) - ;; 6-typing.watsup:493.1-495.36 - rule mem {C : context, mt_1 : memtype, mt_2 : memtype}: - `%|-%<:%`(C, MEM_externtype(mt_1), MEM_externtype(mt_2)) - -- Memtype_sub: `%|-%<:%`(C, mt_1, mt_2) + ;; 6-typing.watsup:485.1-487.39 + rule global {C : context, gt_1 : globaltype, gt_2 : globaltype}: + `%|-%<:%`(C, GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) + -- Globaltype_sub: `%|-%<:%`(C, gt_1, gt_2) + + ;; 6-typing.watsup:481.1-483.36 + rule func {C : context, dt_1 : deftype, dt_2 : deftype}: + `%|-%<:%`(C, FUNC_externtype(dt_1), FUNC_externtype(dt_2)) + -- Deftype_sub: `%|-%<:%`(C, dt_1, dt_2) ;; 6-typing.watsup:565.1-565.76 relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) - ;; 6-typing.watsup:567.1-568.32 - rule void {C : context}: - `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) + ;; 6-typing.watsup:573.1-575.34 + rule typeidx {C : context, ft : functype, x : idx}: + `%|-%:%`(C, _IDX_blocktype(x), ft) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(ft)) ;; 6-typing.watsup:570.1-571.28 rule result {C : context, t : valtype}: `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`([], [t])) - ;; 6-typing.watsup:573.1-575.34 - rule typeidx {C : context, ft : functype, x : idx}: - `%|-%:%`(C, _IDX_blocktype(x), ft) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(ft)) + ;; 6-typing.watsup:567.1-568.32 + rule void {C : context}: + `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) ;; 6-typing.watsup:503.1-505.74 rec { ;; 6-typing.watsup:503.1-503.67 relation Instr_ok: `%|-%:%`(context, instr, functype) - ;; 6-typing.watsup:544.1-545.34 - rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) - - ;; 6-typing.watsup:547.1-548.24 - rule nop {C : context}: - `%|-%:%`(C, NOP_instr, `%->%`([], [])) - - ;; 6-typing.watsup:550.1-551.23 - rule drop {C : context, t : valtype}: - `%|-%:%`(C, DROP_instr, `%->%`([t], [])) - - ;; 6-typing.watsup:554.1-555.31 - rule select-expl {C : context, t : valtype}: - `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) - - ;; 6-typing.watsup:557.1-560.37 - rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: - `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) - -- Valtype_sub: `%|-%<:%`(C, t, t') - -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) + ;; 6-typing.watsup:951.1-956.29 + rule store {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, x : idx}: + `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype $valtype_numtype(nt)], [])) + -- if (C.MEM_context[x] = mt) + -- if ((2 ^ n_A) <= ($size($valtype_numtype(nt)) / 8)) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size($valtype_numtype(nt)) / 8))))?{n} + -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) - ;; 6-typing.watsup:578.1-581.61 - rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:944.1-949.29 + rule load {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, x : idx}: + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [$valtype_numtype(nt)])) + -- if (C.MEM_context[x] = mt) + -- if ((2 ^ n_A) <= ($size($valtype_numtype(nt)) / 8)) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size($valtype_numtype(nt)) / 8))))?{n} + -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) - ;; 6-typing.watsup:583.1-586.61 - rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:940.1-942.23 + rule data.drop {C : context, x : idx}: + `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) + -- if (C.DATA_context[x] = OK) - ;; 6-typing.watsup:588.1-592.65 - rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: - `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) + ;; 6-typing.watsup:935.1-938.23 + rule memory.init {C : context, mt : memtype, x : idx, y : idx}: + `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x] = mt) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:597.1-599.24 - rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.LABEL_context[l] = t*{t}) + ;; 6-typing.watsup:930.1-933.26 + rule memory.copy {C : context, mt_1 : memtype, mt_2 : memtype, x_1 : idx, x_2 : idx}: + `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x_1] = mt_1) + -- if (C.MEM_context[x_2] = mt_2) - ;; 6-typing.watsup:601.1-603.24 - rule br_if {C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) - -- if (C.LABEL_context[l] = t*{t}) + ;; 6-typing.watsup:926.1-928.22 + rule memory.fill {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:605.1-608.44 - rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- (Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l]))*{l} - -- Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l']) + ;; 6-typing.watsup:922.1-924.22 + rule memory.grow {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:610.1-613.31 - rule br_on_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[l] = t*{t}) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:918.1-920.22 + rule memory.size {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:615.1-618.31 - rule br_on_non_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) - -- if (C.LABEL_context[l] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:911.1-913.23 + rule elem.drop {C : context, rt : reftype, x : idx}: + `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) + -- if (C.ELEM_context[x] = rt) - ;; 6-typing.watsup:620.1-626.34 - rule br_on_cast {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype($diffrt(rt_1, rt_2))])) - -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) - -- Reftype_ok: `%|-%:OK`(C, rt_1) - -- Reftype_ok: `%|-%:OK`(C, rt_2) + ;; 6-typing.watsup:905.1-909.36 + rule table.init {C : context, lim : limits, rt_1 : reftype, rt_2 : reftype, x : idx, y : idx}: + `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.TABLE_context[x] = `%%`(lim, rt_1)) + -- if (C.ELEM_context[y] = rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) - ;; 6-typing.watsup:628.1-634.49 - rule br_on_cast_fail {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype(rt_2)])) - -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) - -- Reftype_ok: `%|-%:OK`(C, rt_1) - -- Reftype_ok: `%|-%:OK`(C, rt_2) + ;; 6-typing.watsup:899.1-903.36 + rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt_1 : reftype, rt_2 : reftype, x_1 : idx, x_2 : idx}: + `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt_1)) + -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt_2)) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) - - ;; 6-typing.watsup:639.1-641.24 - rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.RETURN_context = ?(t*{t})) - ;; 6-typing.watsup:643.1-645.46 - rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + ;; 6-typing.watsup:895.1-897.28 + rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:647.1-649.46 - rule call_ref {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_2*{t_2})) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - - ;; 6-typing.watsup:651.1-655.46 - rule call_indirect {C : context, lim : limits, rt : reftype, t_1* : valtype*, t_2* : valtype*, x : idx, y : idx}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + ;; 6-typing.watsup:891.1-893.28 + rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - - ;; 6-typing.watsup:657.1-661.40 - rule return_call {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) - -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:663.1-667.40 - rule return_call_ref {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_4*{t_4})) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + ;; 6-typing.watsup:887.1-889.24 + rule table.size {C : context, tt : tabletype, x : idx}: + `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) + -- if (C.TABLE_context[x] = tt) - ;; 6-typing.watsup:669.1-675.40 - rule return_call_indirect {C : context, lim : limits, rt : reftype, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx, y : idx}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) + ;; 6-typing.watsup:883.1-885.28 + rule table.set {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - - ;; 6-typing.watsup:680.1-681.33 - rule const {C : context, c_nt : c, nt : numtype}: - `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:683.1-684.31 - rule unop {C : context, nt : numtype, unop : unop_numtype}: - `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) + ;; 6-typing.watsup:879.1-881.28 + rule table.get {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:686.1-687.36 - rule binop {C : context, binop : binop_numtype, nt : numtype}: - `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) + ;; 6-typing.watsup:872.1-874.28 + rule global.set {C : context, t : valtype, x : idx}: + `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) + -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?(())), t)) - ;; 6-typing.watsup:689.1-690.36 - rule testop {C : context, nt : numtype, testop : testop_numtype}: - `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) + ;; 6-typing.watsup:868.1-870.28 + rule global.get {C : context, mut : mut, t : valtype, x : idx}: + `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) + -- if (C.GLOBAL_context[x] = `%%`(mut, t)) - ;; 6-typing.watsup:692.1-693.37 - rule relop {C : context, nt : numtype, relop : relop_numtype}: - `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) + ;; 6-typing.watsup:853.1-855.28 + rule local.get {C : context, init : init, t : valtype, x : idx}: + `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) + -- if (C.LOCAL_context[x] = `%%`(init, t)) - ;; 6-typing.watsup:696.1-698.23 - rule extend {C : context, n : n, nt : numtype}: - `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - -- if (n <= $size($valtype_numtype(nt))) + ;; 6-typing.watsup:847.1-848.62 + rule any.convert_extern {C : context, nul : nul}: + `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) - ;; 6-typing.watsup:700.1-703.34 - rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) - -- if (nt_1 =/= nt_2) - -- if ($size($valtype_numtype(nt_1)) = $size($valtype_numtype(nt_2))) + ;; 6-typing.watsup:844.1-845.62 + rule extern.convert_any {C : context, nul : nul}: + `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) - ;; 6-typing.watsup:705.1-708.50 - rule convert-i {C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr($numtype_inn(inn_1), CONVERT_cvtop, $numtype_inn(inn_2), sx?{sx}), `%->%`([$valtype_inn(inn_2)], [$valtype_inn(inn_1)])) - -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> ($size($valtype_inn(inn_1)) > $size($valtype_inn(inn_2)))) + ;; 6-typing.watsup:835.1-839.23 + rule array.init_data {C : context, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:710.1-712.24 - rule convert-f {C : context, fnn_1 : fnn, fnn_2 : fnn}: - `%|-%:%`(C, CVTOP_instr($numtype_fnn(fnn_1), CONVERT_cvtop, $numtype_fnn(fnn_2), ?()), `%->%`([$valtype_fnn(fnn_2)], [$valtype_fnn(fnn_1)])) - -- if (fnn_1 =/= fnn_2) + ;; 6-typing.watsup:830.1-833.43 + rule array.init_elem {C : context, x : idx, y : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- Storagetype_sub: `%|-%<:%`(C, $storagetype_elemtype(C.ELEM_context[y]), zt) - ;; 6-typing.watsup:717.1-719.31 - rule ref.null {C : context, ht : heaptype}: - `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:824.1-828.40 + rule array.copy {C : context, mut : mut, x_1 : idx, x_2 : idx, zt_1 : storagetype, zt_2 : storagetype}: + `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_1))) I32_valtype REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_2))) I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x_1], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) + -- Expand: `%~~%`(C.TYPE_context[x_2], ARRAY_comptype(`%%`(mut, zt_2))) + -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) - ;; 6-typing.watsup:722.1-724.23 - rule ref.func {C : context, dt : deftype, epsilon : resulttype, x : idx}: - `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), $heaptype_deftype(dt))])) - -- if (C.FUNC_context[x] = dt) + ;; 6-typing.watsup:820.1-822.41 + rule array.fill {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt) I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:726.1-727.34 - rule ref.i31 {C : context}: - `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) + ;; 6-typing.watsup:816.1-818.41 + rule array.len {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:729.1-730.31 - rule ref.is_null {C : context, rt : reftype}: - `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) + ;; 6-typing.watsup:812.1-814.41 + rule array.set {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt)], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:732.1-734.31 - rule ref.as_non_null {C : context, ht : heaptype}: - `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:807.1-810.43 + rule array.get {C : context, mut : mut, sx? : sx?, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype], [$unpacktype(zt)])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) - ;; 6-typing.watsup:736.1-737.51 - rule ref.eq {C : context}: - `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) + ;; 6-typing.watsup:801.1-805.23 + rule array.new_data {C : context, mut : mut, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx}: + `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_valtype(t)))) + -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:739.1-743.33 - rule ref.test {C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([$valtype_reftype(rt')], [I32_valtype])) - -- Reftype_ok: `%|-%:OK`(C, rt) - -- Reftype_ok: `%|-%:OK`(C, rt') - -- Reftype_sub: `%|-%<:%`(C, rt, rt') + ;; 6-typing.watsup:796.1-799.39 + rule array.new_elem {C : context, mut : mut, rt : reftype, x : idx, y : idx}: + `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_reftype(rt)))) + -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y], rt) - ;; 6-typing.watsup:745.1-749.33 - rule ref.cast {C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([$valtype_reftype(rt')], [$valtype_reftype(rt)])) - -- Reftype_ok: `%|-%:OK`(C, rt) - -- Reftype_ok: `%|-%:OK`(C, rt') - -- Reftype_sub: `%|-%<:%`(C, rt, rt') + ;; 6-typing.watsup:792.1-794.41 + rule array.new_fixed {C : context, mut : mut, n : n, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpacktype(zt)], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - ;; 6-typing.watsup:754.1-755.42 - rule i31.get {C : context, sx : sx}: - `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) + ;; 6-typing.watsup:787.1-790.40 + rule array.new_default {C : context, mut : mut, val : val, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- if ($default($unpacktype(zt)) = ?(val)) - ;; 6-typing.watsup:760.1-762.43 - rule struct.new {C : context, mut* : mut*, x : idx, zt* : storagetype*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + ;; 6-typing.watsup:783.1-785.41 + rule array.new {C : context, mut : mut, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpacktype(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - ;; 6-typing.watsup:764.1-767.43 - rule struct.new_default {C : context, mut* : mut*, val* : val*, x : idx, zt* : storagetype*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} + ;; 6-typing.watsup:775.1-778.24 + rule struct.set {C : context, i : nat, x : idx, yt* : fieldtype*, zt : storagetype}: + `%|-%:%`(C, STRUCT.SET_instr(x, i), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) $unpacktype(zt)], [])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) + -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) ;; 6-typing.watsup:769.1-773.43 rule struct.get {C : context, i : nat, mut : mut, sx? : sx?, x : idx, yt* : fieldtype*, zt : storagetype}: @@ -6533,219 +6637,265 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- if (yt*{yt}[i] = `%%`(mut, zt)) -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) - ;; 6-typing.watsup:775.1-778.24 - rule struct.set {C : context, i : nat, x : idx, yt* : fieldtype*, zt : storagetype}: - `%|-%:%`(C, STRUCT.SET_instr(x, i), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) $unpacktype(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) + ;; 6-typing.watsup:764.1-767.43 + rule struct.new_default {C : context, mut* : mut*, val* : val*, x : idx, zt* : storagetype*}: + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} - ;; 6-typing.watsup:783.1-785.41 - rule array.new {C : context, mut : mut, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpacktype(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + ;; 6-typing.watsup:760.1-762.43 + rule struct.new {C : context, mut* : mut*, x : idx, zt* : storagetype*}: + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - ;; 6-typing.watsup:787.1-790.40 - rule array.new_default {C : context, mut : mut, val : val, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - -- if ($default($unpacktype(zt)) = ?(val)) + ;; 6-typing.watsup:754.1-755.42 + rule i31.get {C : context, sx : sx}: + `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) - ;; 6-typing.watsup:792.1-794.41 - rule array.new_fixed {C : context, mut : mut, n : n, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpacktype(zt)], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + ;; 6-typing.watsup:745.1-749.33 + rule ref.cast {C : context, rt : reftype, rt' : reftype}: + `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([$valtype_reftype(rt')], [$valtype_reftype(rt)])) + -- Reftype_ok: `%|-%:OK`(C, rt) + -- Reftype_ok: `%|-%:OK`(C, rt') + -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:796.1-799.39 - rule array.new_elem {C : context, mut : mut, rt : reftype, x : idx, y : idx}: - `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_reftype(rt)))) - -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y], rt) + ;; 6-typing.watsup:739.1-743.33 + rule ref.test {C : context, rt : reftype, rt' : reftype}: + `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([$valtype_reftype(rt')], [I32_valtype])) + -- Reftype_ok: `%|-%:OK`(C, rt) + -- Reftype_ok: `%|-%:OK`(C, rt') + -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:801.1-805.23 - rule array.new_data {C : context, mut : mut, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx}: - `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_valtype(t)))) - -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:736.1-737.51 + rule ref.eq {C : context}: + `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) - ;; 6-typing.watsup:807.1-810.43 - rule array.get {C : context, mut : mut, sx? : sx?, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype], [$unpacktype(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) + ;; 6-typing.watsup:732.1-734.31 + rule ref.as_non_null {C : context, ht : heaptype}: + `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:812.1-814.41 - rule array.set {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:729.1-730.31 + rule ref.is_null {C : context, rt : reftype}: + `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) - ;; 6-typing.watsup:816.1-818.41 - rule array.len {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:726.1-727.34 + rule ref.i31 {C : context}: + `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) - ;; 6-typing.watsup:820.1-822.41 - rule array.fill {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt) I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:722.1-724.23 + rule ref.func {C : context, dt : deftype, epsilon : resulttype, x : idx}: + `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), $heaptype_deftype(dt))])) + -- if (C.FUNC_context[x] = dt) - ;; 6-typing.watsup:824.1-828.40 - rule array.copy {C : context, mut : mut, x_1 : idx, x_2 : idx, zt_1 : storagetype, zt_2 : storagetype}: - `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_1))) I32_valtype REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_2))) I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x_1], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) - -- Expand: `%~~%`(C.TYPE_context[x_2], ARRAY_comptype(`%%`(mut, zt_2))) - -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) + ;; 6-typing.watsup:717.1-719.31 + rule ref.null {C : context, ht : heaptype}: + `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:830.1-833.43 - rule array.init_elem {C : context, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- Storagetype_sub: `%|-%<:%`(C, $storagetype_elemtype(C.ELEM_context[y]), zt) + ;; 6-typing.watsup:710.1-712.24 + rule convert-f {C : context, fnn_1 : fnn, fnn_2 : fnn}: + `%|-%:%`(C, CVTOP_instr($numtype_fnn(fnn_1), CONVERT_cvtop, $numtype_fnn(fnn_2), ?()), `%->%`([$valtype_fnn(fnn_2)], [$valtype_fnn(fnn_1)])) + -- if (fnn_1 =/= fnn_2) - ;; 6-typing.watsup:835.1-839.23 - rule array.init_data {C : context, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:705.1-708.50 + rule convert-i {C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: + `%|-%:%`(C, CVTOP_instr($numtype_inn(inn_1), CONVERT_cvtop, $numtype_inn(inn_2), sx?{sx}), `%->%`([$valtype_inn(inn_2)], [$valtype_inn(inn_1)])) + -- if (inn_1 =/= inn_2) + -- if ((sx?{sx} = ?()) <=> ($size($valtype_inn(inn_1)) > $size($valtype_inn(inn_2)))) - ;; 6-typing.watsup:844.1-845.62 - rule extern.convert_any {C : context, nul : nul}: - `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) + ;; 6-typing.watsup:700.1-703.34 + rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype}: + `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) + -- if (nt_1 =/= nt_2) + -- if ($size($valtype_numtype(nt_1)) = $size($valtype_numtype(nt_2))) - ;; 6-typing.watsup:847.1-848.62 - rule any.convert_extern {C : context, nul : nul}: - `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) + ;; 6-typing.watsup:696.1-698.23 + rule extend {C : context, n : n, nt : numtype}: + `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) + -- if (n <= $size($valtype_numtype(nt))) - ;; 6-typing.watsup:853.1-855.28 - rule local.get {C : context, init : init, t : valtype, x : idx}: - `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) - -- if (C.LOCAL_context[x] = `%%`(init, t)) + ;; 6-typing.watsup:692.1-693.37 + rule relop {C : context, nt : numtype, relop : relop_numtype}: + `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) - ;; 6-typing.watsup:868.1-870.28 - rule global.get {C : context, mut : mut, t : valtype, x : idx}: - `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) - -- if (C.GLOBAL_context[x] = `%%`(mut, t)) + ;; 6-typing.watsup:689.1-690.36 + rule testop {C : context, nt : numtype, testop : testop_numtype}: + `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) - ;; 6-typing.watsup:872.1-874.28 - rule global.set {C : context, t : valtype, x : idx}: - `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) - -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?(())), t)) + ;; 6-typing.watsup:686.1-687.36 + rule binop {C : context, binop : binop_numtype, nt : numtype}: + `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:879.1-881.28 - rule table.get {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:683.1-684.31 + rule unop {C : context, nt : numtype, unop : unop_numtype}: + `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:883.1-885.28 - rule table.set {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) + ;; 6-typing.watsup:680.1-681.33 + rule const {C : context, c_nt : c, nt : numtype}: + `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) + + ;; 6-typing.watsup:669.1-675.40 + rule return_call_indirect {C : context, lim : limits, rt : reftype, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx, y : idx}: + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) + -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:887.1-889.24 - rule table.size {C : context, tt : tabletype, x : idx}: - `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) - -- if (C.TABLE_context[x] = tt) + ;; 6-typing.watsup:663.1-667.40 + rule return_call_ref {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_4*{t_4})) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:891.1-893.28 - rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:657.1-661.40 + rule return_call {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) + -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:895.1-897.28 - rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) + ;; 6-typing.watsup:651.1-655.46 + rule call_indirect {C : context, lim : limits, rt : reftype, t_1* : valtype*, t_2* : valtype*, x : idx, y : idx}: + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) + -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:899.1-903.36 - rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt_1 : reftype, rt_2 : reftype, x_1 : idx, x_2 : idx}: - `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt_1)) - -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt_2)) + ;; 6-typing.watsup:647.1-649.46 + rule call_ref {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_2*{t_2})) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + + ;; 6-typing.watsup:643.1-645.46 + rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: + `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + + ;; 6-typing.watsup:639.1-641.24 + rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- if (C.RETURN_context = ?(t*{t})) + + ;; 6-typing.watsup:628.1-634.49 + rule br_on_cast_fail {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype(rt_2)])) + -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) + -- Reftype_ok: `%|-%:OK`(C, rt_1) + -- Reftype_ok: `%|-%:OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) - ;; 6-typing.watsup:905.1-909.36 - rule table.init {C : context, lim : limits, rt_1 : reftype, rt_2 : reftype, x : idx, y : idx}: - `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.TABLE_context[x] = `%%`(lim, rt_1)) - -- if (C.ELEM_context[y] = rt_2) + ;; 6-typing.watsup:620.1-626.34 + rule br_on_cast {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype($diffrt(rt_1, rt_2))])) + -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) + -- Reftype_ok: `%|-%:OK`(C, rt_1) + -- Reftype_ok: `%|-%:OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) - ;; 6-typing.watsup:911.1-913.23 - rule elem.drop {C : context, rt : reftype, x : idx}: - `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) - -- if (C.ELEM_context[x] = rt) + ;; 6-typing.watsup:615.1-618.31 + rule br_on_non_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) + -- if (C.LABEL_context[l] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:918.1-920.22 - rule memory.size {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:610.1-613.31 + rule br_on_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) + -- if (C.LABEL_context[l] = t*{t}) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:922.1-924.22 - rule memory.grow {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:605.1-608.44 + rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- (Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l]))*{l} + -- Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l']) - ;; 6-typing.watsup:926.1-928.22 - rule memory.fill {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:601.1-603.24 + rule br_if {C : context, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) + -- if (C.LABEL_context[l] = t*{t}) - ;; 6-typing.watsup:930.1-933.26 - rule memory.copy {C : context, mt_1 : memtype, mt_2 : memtype, x_1 : idx, x_2 : idx}: - `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x_1] = mt_1) - -- if (C.MEM_context[x_2] = mt_2) + ;; 6-typing.watsup:597.1-599.24 + rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- if (C.LABEL_context[l] = t*{t}) - ;; 6-typing.watsup:935.1-938.23 - rule memory.init {C : context, mt : memtype, x : idx, y : idx}: - `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x] = mt) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:588.1-592.65 + rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) - ;; 6-typing.watsup:940.1-942.23 - rule data.drop {C : context, x : idx}: - `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) - -- if (C.DATA_context[x] = OK) + ;; 6-typing.watsup:583.1-586.61 + rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - ;; 6-typing.watsup:944.1-949.29 - rule load {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, x : idx}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [$valtype_numtype(nt)])) - -- if (C.MEM_context[x] = mt) - -- if ((2 ^ n_A) <= ($size($valtype_numtype(nt)) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size($valtype_numtype(nt)) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) + ;; 6-typing.watsup:578.1-581.61 + rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - ;; 6-typing.watsup:951.1-956.29 - rule store {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, x : idx}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype $valtype_numtype(nt)], [])) - -- if (C.MEM_context[x] = mt) - -- if ((2 ^ n_A) <= ($size($valtype_numtype(nt)) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < ($size($valtype_numtype(nt)) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) + ;; 6-typing.watsup:557.1-560.37 + rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: + `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) + -- Valtype_sub: `%|-%<:%`(C, t, t') + -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) + + ;; 6-typing.watsup:554.1-555.31 + rule select-expl {C : context, t : valtype}: + `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) + + ;; 6-typing.watsup:550.1-551.23 + rule drop {C : context, t : valtype}: + `%|-%:%`(C, DROP_instr, `%->%`([t], [])) + + ;; 6-typing.watsup:547.1-548.24 + rule nop {C : context}: + `%|-%:%`(C, NOP_instr, `%->%`([], [])) + + ;; 6-typing.watsup:544.1-545.34 + rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) ;; 6-typing.watsup:504.1-504.67 relation Instrf_ok: `%|-%:%`(context, instr, instrtype) - ;; 6-typing.watsup:518.1-520.41 - rule instr {C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + ;; 6-typing.watsup:861.1-863.28 + rule local.tee {C : context, init : init, t : valtype, x : idx}: + `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) + -- if (C.LOCAL_context[x] = `%%`(init, t)) ;; 6-typing.watsup:857.1-859.28 rule local.set {C : context, init : init, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) -- if (C.LOCAL_context[x] = `%%`(init, t)) - ;; 6-typing.watsup:861.1-863.28 - rule local.tee {C : context, init : init, t : valtype, x : idx}: - `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) - -- if (C.LOCAL_context[x] = `%%`(init, t)) + ;; 6-typing.watsup:518.1-520.41 + rule instr {C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) ;; 6-typing.watsup:505.1-505.74 relation Instrs_ok: `%|-%*:%`(context, instr*, instrtype) - ;; 6-typing.watsup:522.1-523.29 - rule empty {C : context}: - `%|-%*:%`(C, [], `%->%*%`([], [], [])) + ;; 6-typing.watsup:537.1-539.47 + rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%*:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + + ;; 6-typing.watsup:532.1-535.35 + rule sub {C : context, instr* : instr*, it : instrtype, it' : instrtype}: + `%|-%*:%`(C, instr*{instr}, it') + -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, it) + -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:525.1-530.52 rule seq {C : context, C' : context, init* : init*, instr_1 : instr, instr_2* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, x_1* : idx*, x_2* : idx*}: @@ -6755,16 +6905,9 @@ relation Instrs_ok: `%|-%*:%`(context, instr*, instrtype) -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) -- Instrs_ok: `%|-%*:%`(C', instr_2*{instr_2}, `%->%*%`(t_2*{t_2}, x_2*{x_2}, t_3*{t_3})) - ;; 6-typing.watsup:532.1-535.35 - rule sub {C : context, instr* : instr*, it : instrtype, it' : instrtype}: - `%|-%*:%`(C, instr*{instr}, it') - -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, it) - -- Instrtype_sub: `%|-%<:%`(C, it, it') - - ;; 6-typing.watsup:537.1-539.47 - rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%*:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:522.1-523.29 + rule empty {C : context}: + `%|-%*:%`(C, [], `%->%*%`([], [], [])) } ;; 6-typing.watsup:506.1-506.72 @@ -6779,10 +6922,10 @@ rec { ;; 6-typing.watsup:985.1-985.64 def in_binop : (binop_numtype, ibinop*) -> bool - ;; 6-typing.watsup:986.1-986.38 - def {binop : binop_numtype, epsilon : ibinop*} in_binop(binop, epsilon) = false ;; 6-typing.watsup:987.1-987.92 def {binop : binop_numtype, ibinop'* : ibinop*, ibinop_1 : ibinop} in_binop(binop, [ibinop_1] :: ibinop'*{ibinop'}) = ((binop = _I_binop_numtype(ibinop_1)) \/ $in_binop(binop, ibinop'*{ibinop'})) + ;; 6-typing.watsup:986.1-986.38 + def {binop : binop_numtype, epsilon : ibinop*} in_binop(binop, epsilon) = false } ;; 6-typing.watsup:981.1-981.63 @@ -6790,36 +6933,36 @@ rec { ;; 6-typing.watsup:981.1-981.63 def in_numtype : (numtype, numtype*) -> bool - ;; 6-typing.watsup:982.1-982.37 - def {epsilon : numtype*, nt : numtype} in_numtype(nt, epsilon) = false ;; 6-typing.watsup:983.1-983.68 def {nt : numtype, nt'* : numtype*, nt_1 : numtype} in_numtype(nt, [nt_1] :: nt'*{nt'}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt'})) + ;; 6-typing.watsup:982.1-982.37 + def {epsilon : numtype*, nt : numtype} in_numtype(nt, epsilon) = false } ;; 6-typing.watsup:963.1-963.78 relation Instr_const: `%|-%CONST`(context, instr) - ;; 6-typing.watsup:967.1-968.26 - rule const {C : context, c : c, nt : numtype}: - `%|-%CONST`(C, CONST_instr(nt, c)) + ;; 6-typing.watsup:989.1-992.38 + rule binop {C : context, binop : binop_numtype, nt : numtype}: + `%|-%CONST`(C, BINOP_instr(nt, binop)) + -- if $in_numtype(nt, [I32_numtype I64_numtype]) + -- if $in_binop(binop, [ADD_ibinop SUB_ibinop MUL_ibinop]) - ;; 6-typing.watsup:970.1-971.27 - rule ref.null {C : context, ht : heaptype}: - `%|-%CONST`(C, REF.NULL_instr(ht)) + ;; 6-typing.watsup:976.1-978.24 + rule global.get {C : context, t : valtype, x : idx}: + `%|-%CONST`(C, GLOBAL.GET_instr(x)) + -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?()), t)) ;; 6-typing.watsup:973.1-974.26 rule ref.func {C : context, x : idx}: `%|-%CONST`(C, REF.FUNC_instr(x)) - ;; 6-typing.watsup:976.1-978.24 - rule global.get {C : context, t : valtype, x : idx}: - `%|-%CONST`(C, GLOBAL.GET_instr(x)) - -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?()), t)) + ;; 6-typing.watsup:970.1-971.27 + rule ref.null {C : context, ht : heaptype}: + `%|-%CONST`(C, REF.NULL_instr(ht)) - ;; 6-typing.watsup:989.1-992.38 - rule binop {C : context, binop : binop_numtype, nt : numtype}: - `%|-%CONST`(C, BINOP_instr(nt, binop)) - -- if $in_numtype(nt, [I32_numtype I64_numtype]) - -- if $in_binop(binop, [ADD_ibinop SUB_ibinop MUL_ibinop]) + ;; 6-typing.watsup:967.1-968.26 + rule const {C : context, c : c, nt : numtype}: + `%|-%CONST`(C, CONST_instr(nt, c)) ;; 6-typing.watsup:964.1-964.77 relation Expr_const: `%|-%CONST`(context, expr) @@ -6847,16 +6990,16 @@ relation Type_ok: `%|-%:%*`(context, type, deftype*) ;; 6-typing.watsup:1013.1-1013.74 relation Local_ok: `%|-%:%`(context, local, localtype) - ;; 6-typing.watsup:1029.1-1031.28 - rule set {C : context, t : valtype}: - `%|-%:%`(C, LOCAL(t), `%%`(SET_init, t)) - -- if ($default(t) =/= ?()) - ;; 6-typing.watsup:1033.1-1035.26 rule unset {C : context, t : valtype}: `%|-%:%`(C, LOCAL(t), `%%`(UNSET_init, t)) -- if ($default(t) = ?()) + ;; 6-typing.watsup:1029.1-1031.28 + rule set {C : context, t : valtype}: + `%|-%:%`(C, LOCAL(t), `%%`(SET_init, t)) + -- if ($default(t) =/= ?()) + ;; 6-typing.watsup:1012.1-1012.73 relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup:1037.1-1041.82 @@ -6893,19 +7036,19 @@ relation Mem_ok: `%|-%:%`(context, mem, memtype) ;; 6-typing.watsup:1019.1-1019.77 relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) - ;; 6-typing.watsup:1068.1-1071.45 - rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} + ;; 6-typing.watsup:1076.1-1077.20 + rule declare {C : context, rt : reftype}: + `%|-%:%`(C, DECLARE_elemmode, rt) ;; 6-typing.watsup:1073.1-1074.20 rule passive {C : context, rt : reftype}: `%|-%:%`(C, PASSIVE_elemmode, rt) - ;; 6-typing.watsup:1076.1-1077.20 - rule declare {C : context, rt : reftype}: - `%|-%:%`(C, DECLARE_elemmode, rt) + ;; 6-typing.watsup:1068.1-1071.45 + rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup:1017.1-1017.73 relation Elem_ok: `%|-%:%`(context, elem, reftype) @@ -6917,16 +7060,16 @@ relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup:1020.1-1020.77 relation Datamode_ok: `%|-%:OK`(context, datamode) + ;; 6-typing.watsup:1084.1-1085.20 + rule passive {C : context}: + `%|-%:OK`(C, PASSIVE_datamode) + ;; 6-typing.watsup:1079.1-1082.45 rule active {C : context, expr : expr, mt : memtype, x : idx}: `%|-%:OK`(C, ACTIVE_datamode(x, expr)) -- if (C.MEM_context[x] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 6-typing.watsup:1084.1-1085.20 - rule passive {C : context}: - `%|-%:OK`(C, PASSIVE_datamode) - ;; 6-typing.watsup:1018.1-1018.73 relation Data_ok: `%|-%:OK`(context, data) ;; 6-typing.watsup:1064.1-1066.37 @@ -6950,25 +7093,25 @@ relation Import_ok: `%|-%:%`(context, import, externtype) ;; 6-typing.watsup:1096.1-1096.83 relation Externidx_ok: `%|-%:%`(context, externidx, externtype) - ;; 6-typing.watsup:1107.1-1109.23 - rule func {C : context, dt : deftype, x : idx}: - `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) - -- if (C.FUNC_context[x] = dt) - - ;; 6-typing.watsup:1111.1-1113.25 - rule global {C : context, gt : globaltype, x : idx}: - `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) - -- if (C.GLOBAL_context[x] = gt) + ;; 6-typing.watsup:1119.1-1121.22 + rule mem {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) + -- if (C.MEM_context[x] = mt) ;; 6-typing.watsup:1115.1-1117.24 rule table {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE_externidx(x), TABLE_externtype(tt)) -- if (C.TABLE_context[x] = tt) - ;; 6-typing.watsup:1119.1-1121.22 - rule mem {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:1111.1-1113.25 + rule global {C : context, gt : globaltype, x : idx}: + `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) + -- if (C.GLOBAL_context[x] = gt) + + ;; 6-typing.watsup:1107.1-1109.23 + rule func {C : context, dt : deftype, x : idx}: + `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) + -- if (C.FUNC_context[x] = dt) ;; 6-typing.watsup:1095.1-1095.80 relation Export_ok: `%|-%:%`(context, export, externtype) @@ -6982,15 +7125,15 @@ rec { ;; 6-typing.watsup:1128.1-1128.77 relation Globals_ok: `%|-%*:%*`(context, global*, globaltype*) - ;; 6-typing.watsup:1171.1-1172.17 - rule empty {C : context}: - `%|-%*:%*`(C, [], []) - ;; 6-typing.watsup:1174.1-1177.54 rule cons {C : context, global : global, global_1 : global, gt* : globaltype*, gt_1 : globaltype}: `%|-%*:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt}) -- Global_ok: `%|-%:%`(C, global, gt_1) -- Globals_ok: `%|-%*:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt}) + + ;; 6-typing.watsup:1171.1-1172.17 + rule empty {C : context}: + `%|-%*:%*`(C, [], []) } ;; 6-typing.watsup:1127.1-1127.75 @@ -6998,15 +7141,15 @@ rec { ;; 6-typing.watsup:1127.1-1127.75 relation Types_ok: `%|-%*:%*`(context, type*, deftype*) - ;; 6-typing.watsup:1163.1-1164.17 - rule empty {C : context}: - `%|-%*:%*`(C, [], []) - ;; 6-typing.watsup:1166.1-1169.49 rule cons {C : context, dt* : deftype*, dt_1 : deftype, type* : type*, type_1 : type}: `%|-%*:%*`(C, [type_1] :: type*{type}, dt_1*{} :: dt*{dt}) -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) -- Types_ok: `%|-%*:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, dt*{dt}) + + ;; 6-typing.watsup:1163.1-1164.17 + rule empty {C : context}: + `%|-%*:%*`(C, [], []) } ;; 6-typing.watsup:1126.1-1126.76 @@ -7033,474 +7176,485 @@ relation Module_ok: `|-%:OK`(module) ;; 7-runtime-typing.watsup:5.1-5.40 relation Ref_ok: `%|-%:%`(store, ref, reftype) - ;; 7-runtime-typing.watsup:7.1-8.35 - rule null {ht : heaptype, s : store}: - `%|-%:%`(s, REF.NULL_ref(ht), REF_reftype(`NULL%?`(?(())), ht)) + ;; 7-runtime-typing.watsup:28.1-29.45 + rule extern {addrref : addrref, s : store}: + `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) - ;; 7-runtime-typing.watsup:10.1-11.37 - rule i31 {i : nat, s : store}: - `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) + ;; 7-runtime-typing.watsup:25.1-26.39 + rule host {a : addr, s : store}: + `%|-%:%`(s, REF.HOST_ADDR_ref(a), REF_reftype(`NULL%?`(?()), ANY_heaptype)) - ;; 7-runtime-typing.watsup:13.1-15.30 - rule struct {a : addr, dt : deftype, s : store}: - `%|-%:%`(s, REF.STRUCT_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) - -- if (s.STRUCT_store[a].TYPE_structinst = dt) + ;; 7-runtime-typing.watsup:21.1-23.28 + rule func {a : addr, dt : deftype, s : store}: + `%|-%:%`(s, REF.FUNC_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) + -- if (s.FUNC_store[a].TYPE_funcinst = dt) ;; 7-runtime-typing.watsup:17.1-19.29 rule array {a : addr, dt : deftype, s : store}: `%|-%:%`(s, REF.ARRAY_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) -- if (s.ARRAY_store[a].TYPE_arrayinst = dt) - ;; 7-runtime-typing.watsup:21.1-23.28 - rule func {a : addr, dt : deftype, s : store}: - `%|-%:%`(s, REF.FUNC_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) - -- if (s.FUNC_store[a].TYPE_funcinst = dt) + ;; 7-runtime-typing.watsup:13.1-15.30 + rule struct {a : addr, dt : deftype, s : store}: + `%|-%:%`(s, REF.STRUCT_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) + -- if (s.STRUCT_store[a].TYPE_structinst = dt) - ;; 7-runtime-typing.watsup:25.1-26.39 - rule host {a : addr, s : store}: - `%|-%:%`(s, REF.HOST_ADDR_ref(a), REF_reftype(`NULL%?`(?()), ANY_heaptype)) + ;; 7-runtime-typing.watsup:10.1-11.37 + rule i31 {i : nat, s : store}: + `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) - ;; 7-runtime-typing.watsup:28.1-29.45 - rule extern {addrref : addrref, s : store}: - `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) + ;; 7-runtime-typing.watsup:7.1-8.35 + rule null {ht : heaptype, s : store}: + `%|-%:%`(s, REF.NULL_ref(ht), REF_reftype(`NULL%?`(?(())), ht)) ;; 8-reduction.watsup:6.1-6.63 relation Step_pure: `%*~>%*`(admininstr*, admininstr*) - ;; 8-reduction.watsup:42.1-43.24 - rule unreachable: - `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) - - ;; 8-reduction.watsup:45.1-46.15 - rule nop: - `%*~>%*`([NOP_admininstr], []) + ;; 8-reduction.watsup:552.1-553.47 + rule local.tee {val : val, x : idx}: + `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) - ;; 8-reduction.watsup:48.1-49.20 - rule drop {val : val}: - `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) + ;; 8-reduction.watsup:539.1-540.55 + rule any.convert_extern-addr {addrref : addrref}: + `%*~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [$admininstr_addrref(addrref)]) - ;; 8-reduction.watsup:52.1-54.16 - rule select-true {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: - `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_1)]) - -- if (c =/= 0) + ;; 8-reduction.watsup:536.1-537.55 + rule any.convert_extern-null {ht : heaptype}: + `%*~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) - ;; 8-reduction.watsup:56.1-58.14 - rule select-false {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: - `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_2)]) - -- if (c = 0) - - ;; 8-reduction.watsup:76.1-78.16 - rule if-true {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) - -- if (c =/= 0) - - ;; 8-reduction.watsup:80.1-82.14 - rule if-false {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) - -- if (c = 0) + ;; 8-reduction.watsup:532.1-533.55 + rule extern.convert_any-addr {addrref : addrref}: + `%*~>%*`([$admininstr_addrref(addrref) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) - ;; 8-reduction.watsup:85.1-86.38 - rule label-vals {instr* : instr*, n : n, val* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) + ;; 8-reduction.watsup:529.1-530.58 + rule extern.convert_any-null {ht : heaptype}: + `%*~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) - ;; 8-reduction.watsup:92.1-93.69 - rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) + ;; 8-reduction.watsup:311.1-312.68 + rule i31.get-num {i : nat, sx : sx}: + `%*~>%*`([REF.I31_NUM_admininstr(i) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, i))]) - ;; 8-reduction.watsup:95.1-96.65 - rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) + ;; 8-reduction.watsup:308.1-309.39 + rule i31.get-null {ht : heaptype, sx : sx}: + `%*~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) - ;; 8-reduction.watsup:99.1-101.16 - rule br_if-true {c : c, l : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) - -- if (c =/= 0) + ;; 8-reduction.watsup:281.1-283.15 + rule ref.eq-false {ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 0)]) + -- otherwise - ;; 8-reduction.watsup:103.1-105.14 - rule br_if-false {c : c, l : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) - -- if (c = 0) + ;; 8-reduction.watsup:276.1-279.22 + rule ref.eq-true {ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- otherwise + -- if (ref_1 = ref_2) - ;; 8-reduction.watsup:108.1-110.17 - rule br_table-lt {i : nat, l* : labelidx*, l' : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) - -- if (i < |l*{l}|) + ;; 8-reduction.watsup:272.1-274.55 + rule ref.eq-null {ht_1 : heaptype, ht_2 : heaptype, ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) - ;; 8-reduction.watsup:112.1-114.18 - rule br_table-ge {i : nat, l* : labelidx*, l' : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) - -- if (i >= |l*{l}|) + ;; 8-reduction.watsup:267.1-269.15 + rule ref.as_non_null-addr {ref : ref}: + `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [$admininstr_ref(ref)]) + -- otherwise - ;; 8-reduction.watsup:117.1-119.26 - rule br_on_null-null {ht : heaptype, l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) - -- if (val = REF.NULL_val(ht)) + ;; 8-reduction.watsup:263.1-265.28 + rule ref.as_non_null-null {ht : heaptype, ref : ref}: + `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) + -- if (ref = REF.NULL_ref(ht)) - ;; 8-reduction.watsup:121.1-123.15 - rule br_on_null-addr {l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [$admininstr_val(val)]) + ;; 8-reduction.watsup:258.1-260.15 + rule ref.is_null-false {val : val}: + `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 8-reduction.watsup:126.1-128.26 - rule br_on_non_null-null {ht : heaptype, l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], []) + ;; 8-reduction.watsup:254.1-256.28 + rule ref.is_null-true {ht : heaptype, val : val}: + `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:130.1-132.15 - rule br_on_non_null-addr {l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], [$admininstr_val(val) BR_admininstr(l)]) - -- otherwise - - ;; 8-reduction.watsup:186.1-187.84 - rule call_indirect-call {x : idx, y : idx}: - `%*~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) CALL_REF_admininstr(?(y))]) + ;; 8-reduction.watsup:250.1-251.60 + rule ref.i31 {i : nat}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, i))]) - ;; 8-reduction.watsup:189.1-190.98 - rule return_call_indirect {x : idx, y : idx}: - `%*~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) RETURN_CALL_REF_admininstr(?(y))]) + ;; 8-reduction.watsup:240.1-242.50 + rule cvtop-trap {c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: + `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) + -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = []) - ;; 8-reduction.watsup:193.1-194.35 - rule frame-vals {f : frame, n : n, val^n : val^n}: - `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) + ;; 8-reduction.watsup:236.1-238.48 + rule cvtop-val {c : c, c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: + `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) + -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = [c]) - ;; 8-reduction.watsup:196.1-197.55 - rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: - `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) + ;; 8-reduction.watsup:232.1-233.70 + rule extend {c : c, n : n, nt : numtype}: + `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, $size($valtype_numtype(nt)), S_sx, c))]) - ;; 8-reduction.watsup:199.1-200.60 - rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: - `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) + ;; 8-reduction.watsup:227.1-229.40 + rule relop {c : c, c_1 : c, c_2 : c, nt : numtype, relop : relop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) + -- if (c = $relop(relop, nt, c_1, c_2)) - ;; 8-reduction.watsup:205.1-207.33 - rule unop-val {c : c, c_1 : c, nt : numtype, unop : unop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) - -- if ($unop(unop, nt, c_1) = [c]) + ;; 8-reduction.watsup:223.1-225.37 + rule testop {c : c, c_1 : c, nt : numtype, testop : testop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) + -- if (c = $testop(testop, nt, c_1)) - ;; 8-reduction.watsup:209.1-211.35 - rule unop-trap {c_1 : c, nt : numtype, unop : unop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) - -- if ($unop(unop, nt, c_1) = []) + ;; 8-reduction.watsup:218.1-220.42 + rule binop-trap {binop : binop_numtype, c_1 : c, c_2 : c, nt : numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) + -- if ($binop(binop, nt, c_1, c_2) = []) ;; 8-reduction.watsup:214.1-216.40 rule binop-val {binop : binop_numtype, c : c, c_1 : c, c_2 : c, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(binop, nt, c_1, c_2) = [c]) - ;; 8-reduction.watsup:218.1-220.42 - rule binop-trap {binop : binop_numtype, c_1 : c, c_2 : c, nt : numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) - -- if ($binop(binop, nt, c_1, c_2) = []) - - ;; 8-reduction.watsup:223.1-225.37 - rule testop {c : c, c_1 : c, nt : numtype, testop : testop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) - -- if (c = $testop(testop, nt, c_1)) + ;; 8-reduction.watsup:209.1-211.35 + rule unop-trap {c_1 : c, nt : numtype, unop : unop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) + -- if ($unop(unop, nt, c_1) = []) - ;; 8-reduction.watsup:227.1-229.40 - rule relop {c : c, c_1 : c, c_2 : c, nt : numtype, relop : relop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) - -- if (c = $relop(relop, nt, c_1, c_2)) + ;; 8-reduction.watsup:205.1-207.33 + rule unop-val {c : c, c_1 : c, nt : numtype, unop : unop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) + -- if ($unop(unop, nt, c_1) = [c]) - ;; 8-reduction.watsup:232.1-233.70 - rule extend {c : c, n : n, nt : numtype}: - `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, $size($valtype_numtype(nt)), S_sx, c))]) + ;; 8-reduction.watsup:199.1-200.60 + rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: + `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) - ;; 8-reduction.watsup:236.1-238.48 - rule cvtop-val {c : c, c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: - `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) - -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = [c]) + ;; 8-reduction.watsup:196.1-197.55 + rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: + `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) - ;; 8-reduction.watsup:240.1-242.50 - rule cvtop-trap {c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: - `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) - -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = []) + ;; 8-reduction.watsup:193.1-194.35 + rule frame-vals {f : frame, n : n, val^n : val^n}: + `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) - ;; 8-reduction.watsup:250.1-251.60 - rule ref.i31 {i : nat}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, i))]) + ;; 8-reduction.watsup:189.1-190.98 + rule return_call_indirect {x : idx, y : idx}: + `%*~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) RETURN_CALL_REF_admininstr(?(y))]) - ;; 8-reduction.watsup:254.1-256.28 - rule ref.is_null-true {ht : heaptype, val : val}: - `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- if (val = REF.NULL_val(ht)) + ;; 8-reduction.watsup:186.1-187.84 + rule call_indirect-call {x : idx, y : idx}: + `%*~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) CALL_REF_admininstr(?(y))]) - ;; 8-reduction.watsup:258.1-260.15 - rule ref.is_null-false {val : val}: - `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) + ;; 8-reduction.watsup:130.1-132.15 + rule br_on_non_null-addr {l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], [$admininstr_val(val) BR_admininstr(l)]) -- otherwise - ;; 8-reduction.watsup:263.1-265.28 - rule ref.as_non_null-null {ht : heaptype, ref : ref}: - `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) - -- if (ref = REF.NULL_ref(ht)) + ;; 8-reduction.watsup:126.1-128.26 + rule br_on_non_null-null {ht : heaptype, l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], []) + -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:267.1-269.15 - rule ref.as_non_null-addr {ref : ref}: - `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [$admininstr_ref(ref)]) + ;; 8-reduction.watsup:121.1-123.15 + rule br_on_null-addr {l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [$admininstr_val(val)]) -- otherwise - ;; 8-reduction.watsup:272.1-274.55 - rule ref.eq-null {ht_1 : heaptype, ht_2 : heaptype, ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) + ;; 8-reduction.watsup:117.1-119.26 + rule br_on_null-null {ht : heaptype, l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) + -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:276.1-279.22 - rule ref.eq-true {ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- otherwise - -- if (ref_1 = ref_2) + ;; 8-reduction.watsup:112.1-114.18 + rule br_table-ge {i : nat, l* : labelidx*, l' : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) + -- if (i >= |l*{l}|) - ;; 8-reduction.watsup:281.1-283.15 - rule ref.eq-false {ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 0)]) - -- otherwise + ;; 8-reduction.watsup:108.1-110.17 + rule br_table-lt {i : nat, l* : labelidx*, l' : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) + -- if (i < |l*{l}|) - ;; 8-reduction.watsup:308.1-309.39 - rule i31.get-null {ht : heaptype, sx : sx}: - `%*~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) + ;; 8-reduction.watsup:103.1-105.14 + rule br_if-false {c : c, l : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) + -- if (c = 0) - ;; 8-reduction.watsup:311.1-312.68 - rule i31.get-num {i : nat, sx : sx}: - `%*~>%*`([REF.I31_NUM_admininstr(i) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, i))]) + ;; 8-reduction.watsup:99.1-101.16 + rule br_if-true {c : c, l : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) + -- if (c =/= 0) - ;; 8-reduction.watsup:529.1-530.58 - rule extern.convert_any-null {ht : heaptype}: - `%*~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) + ;; 8-reduction.watsup:95.1-96.65 + rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) - ;; 8-reduction.watsup:532.1-533.55 - rule extern.convert_any-addr {addrref : addrref}: - `%*~>%*`([$admininstr_addrref(addrref) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) + ;; 8-reduction.watsup:92.1-93.69 + rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) - ;; 8-reduction.watsup:536.1-537.55 - rule any.convert_extern-null {ht : heaptype}: - `%*~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) + ;; 8-reduction.watsup:85.1-86.38 + rule label-vals {instr* : instr*, n : n, val* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) - ;; 8-reduction.watsup:539.1-540.55 - rule any.convert_extern-addr {addrref : addrref}: - `%*~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [$admininstr_addrref(addrref)]) + ;; 8-reduction.watsup:80.1-82.14 + rule if-false {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) + -- if (c = 0) - ;; 8-reduction.watsup:552.1-553.47 - rule local.tee {val : val, x : idx}: - `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) + ;; 8-reduction.watsup:76.1-78.16 + rule if-true {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) + -- if (c =/= 0) + + ;; 8-reduction.watsup:56.1-58.14 + rule select-false {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: + `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_2)]) + -- if (c = 0) + + ;; 8-reduction.watsup:52.1-54.16 + rule select-true {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: + `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_1)]) + -- if (c =/= 0) + + ;; 8-reduction.watsup:48.1-49.20 + rule drop {val : val}: + `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) + + ;; 8-reduction.watsup:45.1-46.15 + rule nop: + `%*~>%*`([NOP_admininstr], []) + + ;; 8-reduction.watsup:42.1-43.24 + rule unreachable: + `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) ;; 8-reduction.watsup:63.1-63.73 def blocktype : (state, blocktype) -> functype - ;; 8-reduction.watsup:64.1-64.44 - def {z : state} blocktype(z, _RESULT_blocktype(?())) = `%->%`([], []) - ;; 8-reduction.watsup:65.1-65.40 - def {t : valtype, z : state} blocktype(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) ;; 8-reduction.watsup:66.1-66.66 def {ft : functype, x : idx, z : state} blocktype(z, _IDX_blocktype(x)) = ft -- Expand: `%~~%`($type(z, x), FUNC_comptype(ft)) + ;; 8-reduction.watsup:65.1-65.40 + def {t : valtype, z : state} blocktype(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) + ;; 8-reduction.watsup:64.1-64.44 + def {z : state} blocktype(z, _RESULT_blocktype(?())) = `%->%`([], []) ;; 8-reduction.watsup:7.1-7.63 relation Step_read: `%~>%*`(config, admininstr*) - ;; 8-reduction.watsup:68.1-70.43 - rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + ;; 8-reduction.watsup:753.1-757.15 + rule memory.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, y).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x, y)]) + -- otherwise - ;; 8-reduction.watsup:72.1-74.43 - rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + ;; 8-reduction.watsup:748.1-751.14 + rule memory.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:135.1-138.66 - rule br_on_cast-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt) - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) + ;; 8-reduction.watsup:744.1-746.70 + rule memory.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) - ;; 8-reduction.watsup:140.1-142.15 - rule br_on_cast-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) + ;; 8-reduction.watsup:737.1-741.15 + rule memory.copy-gt {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise - ;; 8-reduction.watsup:145.1-148.66 - rule br_on_cast_fail-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt) - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) + ;; 8-reduction.watsup:730.1-735.19 + rule memory.copy-le {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, (i_1 + 1)) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) + -- otherwise + -- if (i_1 <= i_2) - ;; 8-reduction.watsup:150.1-152.15 - rule br_on_cast_fail-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) + ;; 8-reduction.watsup:725.1-728.14 + rule memory.copy-zero {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), []) -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:157.1-158.62 - rule call {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) CALL_REF_admininstr(?())]) + ;; 8-reduction.watsup:721.1-723.77 + rule memory.copy-oob {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) - ;; 8-reduction.watsup:160.1-161.43 - rule call_ref-null {ht : heaptype, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) + ;; 8-reduction.watsup:714.1-718.15 + rule memory.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr(x)]) + -- otherwise - ;; 8-reduction.watsup:163.1-168.59 - rule call_ref-func {a : addr, f : frame, fi : funcinst, instr* : instr*, m : m, n : n, t* : valtype*, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, x? : idx?, y : idx, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], $admininstr_instr(instr)*{instr})])]) - -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) - -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) + ;; 8-reduction.watsup:709.1-712.14 + rule memory.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:171.1-172.76 - rule return_call {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) RETURN_CALL_REF_admininstr(?())]) + ;; 8-reduction.watsup:705.1-707.37 + rule memory.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:175.1-176.78 - rule return_call_ref-frame-null {f : frame, ht : heaptype, instr* : instr*, k : nat, val* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), [TRAP_admininstr]) + ;; 8-reduction.watsup:692.1-694.44 + rule memory.size {n : n, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) + -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:178.1-180.59 - rule return_call_ref-frame-addr {a : addr, f : frame, instr* : instr*, k : nat, m : m, n : n, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, val'* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + ;; 8-reduction.watsup:670.1-672.61 + rule load-pack-val {c : c, i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [CONST_admininstr(nt, $ext(n, $size($valtype_numtype(nt)), sx, c))]) + -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) - ;; 8-reduction.watsup:182.1-183.91 - rule return_call_ref-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) + ;; 8-reduction.watsup:666.1-668.51 + rule load-pack-oob {i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [TRAP_admininstr]) + -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:247.1-248.55 - rule ref.func {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) + ;; 8-reduction.watsup:662.1-664.71 + rule load-num-val {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) + -- if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : ($size($valtype_numtype(nt)) / 8)]) - ;; 8-reduction.watsup:286.1-289.65 - rule ref.test-true {ref : ref, rt : reftype, rt' : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 1)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt') - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) + ;; 8-reduction.watsup:658.1-660.59 + rule load-num-oob {i : nat, mo : memop, nt : numtype, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) + -- if (((i + mo.OFFSET_memop) + ($size($valtype_numtype(nt)) / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:291.1-293.15 - rule ref.test-false {ref : ref, rt : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 0)]) + ;; 8-reduction.watsup:645.1-649.15 + rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.INIT_admininstr(x, y)]) -- otherwise - ;; 8-reduction.watsup:296.1-299.65 - rule ref.cast-succeed {ref : ref, rt : reftype, rt' : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [$admininstr_ref(ref)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt') - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) - - ;; 8-reduction.watsup:301.1-303.15 - rule ref.cast-fail {ref : ref, rt : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:640.1-643.14 + rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), []) -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:322.1-325.43 - rule struct.new_default {mut* : mut*, val* : val*, x : idx, z : state, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)*{val} :: [STRUCT.NEW_admininstr(x)]) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} - - ;; 8-reduction.watsup:328.1-329.50 - rule struct.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:636.1-638.72 + rule table.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) - ;; 8-reduction.watsup:331.1-334.41 - rule struct.get-struct {a : addr, i : nat, mut* : mut*, si : structinst, sx? : sx?, x : idx, z : state, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [$admininstr_val($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]))]) - -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + ;; 8-reduction.watsup:629.1-633.15 + rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) + -- otherwise - ;; 8-reduction.watsup:348.1-349.70 - rule array.new {n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.NEW_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + ;; 8-reduction.watsup:622.1-627.15 + rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) + -- otherwise + -- if (j <= i) - ;; 8-reduction.watsup:351.1-354.40 - rule array.new_default {mut : mut, n : n, val : val, x : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) ARRAY.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ($default($unpacktype(zt)) = ?(val)) + ;; 8-reduction.watsup:617.1-620.14 + rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:362.1-364.38 - rule array.new_elem-oob {i : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) + ;; 8-reduction.watsup:613.1-615.73 + rule table.copy-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) - ;; 8-reduction.watsup:366.1-368.40 - rule array.new_elem-alloc {i : nat, n : n, ref^n : ref^n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), $admininstr_ref(ref)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) + ;; 8-reduction.watsup:606.1-610.15 + rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) + -- otherwise - ;; 8-reduction.watsup:371.1-374.59 - rule array.new_data-oob {i : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) - - ;; 8-reduction.watsup:376.1-380.88 - rule array.new_data-alloc {c^n : c^n, i : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (nt = $unpacknumtype(zt)) - -- if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) + ;; 8-reduction.watsup:601.1-604.14 + rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:383.1-384.61 - rule array.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:597.1-599.39 + rule table.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:386.1-388.38 - rule array.get-oob {a : addr, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) - -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:584.1-586.32 + rule table.size {n : n, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) + -- if (|$table(z, x).ELEM_tableinst| = n) - ;; 8-reduction.watsup:390.1-393.53 - rule array.get-array {a : addr, fv : fieldval, i : nat, mut : mut, sx? : sx?, x : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [$admininstr_val($unpackval(zt, sx?{sx}, fv))]) - -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) - -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) + ;; 8-reduction.watsup:571.1-573.32 + rule table.get-val {i : nat, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) + -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:409.1-410.39 - rule array.len-null {ht : heaptype, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) + ;; 8-reduction.watsup:567.1-569.33 + rule table.get-oob {i : nat, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) + -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:412.1-414.37 - rule array.len-array {a : addr, n : n, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, n)]) - -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:558.1-559.45 + rule global.get {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) - ;; 8-reduction.watsup:417.1-418.76 - rule array.fill-null {ht : heaptype, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:545.1-547.27 + rule local.get {val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val(val)]) + -- if ($local(z, x) = ?(val)) - ;; 8-reduction.watsup:420.1-422.44 - rule array.fill-oob {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:517.1-524.67 + rule array.init_data-succ {a : addr, c : c, i : nat, j : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + ($storagesize(zt) / 8))) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_DATA_admininstr(x, y)]) + -- otherwise + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (nt = $unpacknumtype(zt)) + -- if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) - ;; 8-reduction.watsup:424.1-427.14 - rule array.fill-zero {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), []) + ;; 8-reduction.watsup:512.1-515.14 + rule array.init_data-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), []) -- otherwise -- if (n = 0) - ;; 8-reduction.watsup:429.1-433.15 - rule array.fill-succ {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.FILL_admininstr(x)]) + ;; 8-reduction.watsup:507.1-510.59 + rule array.init_data-oob2 {a : addr, i : nat, j : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) + + ;; 8-reduction.watsup:503.1-505.44 + rule array.init_data-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) + + ;; 8-reduction.watsup:500.1-501.93 + rule array.init_data-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + + ;; 8-reduction.watsup:492.1-497.34 + rule array.init_elem-succ {a : addr, i : nat, j : nat, n : n, ref : ref, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_ELEM_admininstr(x, y)]) -- otherwise + -- if (ref = $elem(z, y).ELEM_eleminst[j]) - ;; 8-reduction.watsup:435.1-436.102 - rule array.copy-null1 {ht_1 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, i_1) $admininstr_ref(ref) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:487.1-490.14 + rule array.init_elem-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:438.1-439.102 - rule array.copy-null2 {ht_2 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, i_1) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:483.1-485.38 + rule array.init_elem-oob2 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) - ;; 8-reduction.watsup:441.1-443.48 - rule array.copy-oob1 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) + ;; 8-reduction.watsup:479.1-481.44 + rule array.init_elem-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:445.1-447.48 - rule array.copy-oob2 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) + ;; 8-reduction.watsup:476.1-477.93 + rule array.init_elem-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:449.1-452.14 - rule array.copy-zero {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), []) + ;; 8-reduction.watsup:465.1-473.29 + rule array.copy-gt {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise - -- if (n = 0) + -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) + -- if (sx?{sx} = $sxfield(zt_2)) ;; 8-reduction.watsup:454.1-463.19 rule array.copy-le {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: @@ -7510,352 +7664,341 @@ relation Step_read: `%~>%*`(config, admininstr*) -- if (sx?{sx} = $sxfield(zt_2)) -- if (i_1 <= i_2) - ;; 8-reduction.watsup:465.1-473.29 - rule array.copy-gt {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) + ;; 8-reduction.watsup:449.1-452.14 + rule array.copy-zero {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), []) -- otherwise - -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (n = 0) - ;; 8-reduction.watsup:476.1-477.93 - rule array.init_elem-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:445.1-447.48 + rule array.copy-oob2 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) - ;; 8-reduction.watsup:479.1-481.44 - rule array.init_elem-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:441.1-443.48 + rule array.copy-oob1 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) - ;; 8-reduction.watsup:483.1-485.38 - rule array.init_elem-oob2 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) + ;; 8-reduction.watsup:438.1-439.102 + rule array.copy-null2 {ht_2 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, i_1) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:487.1-490.14 - rule array.init_elem-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:435.1-436.102 + rule array.copy-null1 {ht_1 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, i_1) $admininstr_ref(ref) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:492.1-497.34 - rule array.init_elem-succ {a : addr, i : nat, j : nat, n : n, ref : ref, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_ELEM_admininstr(x, y)]) + ;; 8-reduction.watsup:429.1-433.15 + rule array.fill-succ {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.FILL_admininstr(x)]) -- otherwise - -- if (ref = $elem(z, y).ELEM_eleminst[j]) - - ;; 8-reduction.watsup:500.1-501.93 - rule array.init_data-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - - ;; 8-reduction.watsup:503.1-505.44 - rule array.init_data-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - - ;; 8-reduction.watsup:507.1-510.59 - rule array.init_data-oob2 {a : addr, i : nat, j : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) - ;; 8-reduction.watsup:512.1-515.14 - rule array.init_data-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), []) + ;; 8-reduction.watsup:424.1-427.14 + rule array.fill-zero {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 8-reduction.watsup:517.1-524.67 - rule array.init_data-succ {a : addr, c : c, i : nat, j : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + ($storagesize(zt) / 8))) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_DATA_admininstr(x, y)]) - -- otherwise - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (nt = $unpacknumtype(zt)) - -- if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) + ;; 8-reduction.watsup:420.1-422.44 + rule array.fill-oob {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:545.1-547.27 - rule local.get {val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val(val)]) - -- if ($local(z, x) = ?(val)) + ;; 8-reduction.watsup:417.1-418.76 + rule array.fill-null {ht : heaptype, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:558.1-559.45 - rule global.get {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) + ;; 8-reduction.watsup:412.1-414.37 + rule array.len-array {a : addr, n : n, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, n)]) + -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:567.1-569.33 - rule table.get-oob {i : nat, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) - -- if (i >= |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:409.1-410.39 + rule array.len-null {ht : heaptype, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) - ;; 8-reduction.watsup:571.1-573.32 - rule table.get-val {i : nat, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) - -- if (i < |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:390.1-393.53 + rule array.get-array {a : addr, fv : fieldval, i : nat, mut : mut, sx? : sx?, x : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [$admininstr_val($unpackval(zt, sx?{sx}, fv))]) + -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) + -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) - ;; 8-reduction.watsup:584.1-586.32 - rule table.size {n : n, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) - -- if (|$table(z, x).ELEM_tableinst| = n) + ;; 8-reduction.watsup:386.1-388.38 + rule array.get-oob {a : addr, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:597.1-599.39 - rule table.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:383.1-384.61 + rule array.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:601.1-604.14 - rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:376.1-380.88 + rule array.new_data-alloc {c^n : c^n, i : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (nt = $unpacknumtype(zt)) + -- if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) - ;; 8-reduction.watsup:606.1-610.15 - rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) - -- otherwise + ;; 8-reduction.watsup:371.1-374.59 + rule array.new_data-oob {i : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) - ;; 8-reduction.watsup:613.1-615.73 - rule table.copy-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) + ;; 8-reduction.watsup:366.1-368.40 + rule array.new_elem-alloc {i : nat, n : n, ref^n : ref^n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), $admininstr_ref(ref)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) - ;; 8-reduction.watsup:617.1-620.14 - rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:362.1-364.38 + rule array.new_elem-oob {i : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) - ;; 8-reduction.watsup:622.1-627.15 - rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) - -- otherwise - -- if (j <= i) + ;; 8-reduction.watsup:351.1-354.40 + rule array.new_default {mut : mut, n : n, val : val, x : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) ARRAY.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ($default($unpacktype(zt)) = ?(val)) - ;; 8-reduction.watsup:629.1-633.15 - rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) - -- otherwise + ;; 8-reduction.watsup:348.1-349.70 + rule array.new {n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.NEW_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - ;; 8-reduction.watsup:636.1-638.72 - rule table.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) + ;; 8-reduction.watsup:331.1-334.41 + rule struct.get-struct {a : addr, i : nat, mut* : mut*, si : structinst, sx? : sx?, x : idx, z : state, zt* : storagetype*}: + `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [$admininstr_val($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]))]) + -- if ($structinst(z)[a] = si) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - ;; 8-reduction.watsup:640.1-643.14 - rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), []) + ;; 8-reduction.watsup:328.1-329.50 + rule struct.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [TRAP_admininstr]) + + ;; 8-reduction.watsup:322.1-325.43 + rule struct.new_default {mut* : mut*, val* : val*, x : idx, z : state, zt* : storagetype*}: + `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)*{val} :: [STRUCT.NEW_admininstr(x)]) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} + + ;; 8-reduction.watsup:301.1-303.15 + rule ref.cast-fail {ref : ref, rt : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) -- otherwise - -- if (n = 0) - ;; 8-reduction.watsup:645.1-649.15 - rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.INIT_admininstr(x, y)]) + ;; 8-reduction.watsup:296.1-299.65 + rule ref.cast-succeed {ref : ref, rt : reftype, rt' : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [$admininstr_ref(ref)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt') + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) + + ;; 8-reduction.watsup:291.1-293.15 + rule ref.test-false {ref : ref, rt : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 8-reduction.watsup:658.1-660.59 - rule load-num-oob {i : nat, mo : memop, nt : numtype, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) - -- if (((i + mo.OFFSET_memop) + ($size($valtype_numtype(nt)) / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:286.1-289.65 + rule ref.test-true {ref : ref, rt : reftype, rt' : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 1)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt') + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) - ;; 8-reduction.watsup:662.1-664.71 - rule load-num-val {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) - -- if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : ($size($valtype_numtype(nt)) / 8)]) + ;; 8-reduction.watsup:247.1-248.55 + rule ref.func {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) - ;; 8-reduction.watsup:666.1-668.51 - rule load-pack-oob {i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [TRAP_admininstr]) - -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:182.1-183.91 + rule return_call_ref-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) - ;; 8-reduction.watsup:670.1-672.61 - rule load-pack-val {c : c, i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [CONST_admininstr(nt, $ext(n, $size($valtype_numtype(nt)), sx, c))]) - -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) + ;; 8-reduction.watsup:178.1-180.59 + rule return_call_ref-frame-addr {a : addr, f : frame, instr* : instr*, k : nat, m : m, n : n, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, val'* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - ;; 8-reduction.watsup:692.1-694.44 - rule memory.size {n : n, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) - -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:175.1-176.78 + rule return_call_ref-frame-null {f : frame, ht : heaptype, instr* : instr*, k : nat, val* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), [TRAP_admininstr]) - ;; 8-reduction.watsup:705.1-707.37 - rule memory.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:171.1-172.76 + rule return_call {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) RETURN_CALL_REF_admininstr(?())]) - ;; 8-reduction.watsup:709.1-712.14 - rule memory.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:163.1-168.59 + rule call_ref-func {a : addr, f : frame, fi : funcinst, instr* : instr*, m : m, n : n, t* : valtype*, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, x? : idx?, y : idx, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], $admininstr_instr(instr)*{instr})])]) + -- if ($funcinst(z)[a] = fi) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) + -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) - ;; 8-reduction.watsup:714.1-718.15 - rule memory.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr(x)]) - -- otherwise + ;; 8-reduction.watsup:160.1-161.43 + rule call_ref-null {ht : heaptype, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) - ;; 8-reduction.watsup:721.1-723.77 - rule memory.copy-oob {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) + ;; 8-reduction.watsup:157.1-158.62 + rule call {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) CALL_REF_admininstr(?())]) - ;; 8-reduction.watsup:725.1-728.14 - rule memory.copy-zero {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), []) + ;; 8-reduction.watsup:150.1-152.15 + rule br_on_cast_fail-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) -- otherwise - -- if (n = 0) - ;; 8-reduction.watsup:730.1-735.19 - rule memory.copy-le {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, (i_1 + 1)) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) - -- otherwise - -- if (i_1 <= i_2) + ;; 8-reduction.watsup:145.1-148.66 + rule br_on_cast_fail-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt) + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) - ;; 8-reduction.watsup:737.1-741.15 - rule memory.copy-gt {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) + ;; 8-reduction.watsup:140.1-142.15 + rule br_on_cast-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) -- otherwise - ;; 8-reduction.watsup:744.1-746.70 - rule memory.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) + ;; 8-reduction.watsup:135.1-138.66 + rule br_on_cast-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt) + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) - ;; 8-reduction.watsup:748.1-751.14 - rule memory.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:72.1-74.43 + rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 8-reduction.watsup:753.1-757.15 - rule memory.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, y).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x, y)]) - -- otherwise + ;; 8-reduction.watsup:68.1-70.43 + rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) ;; 8-reduction.watsup:5.1-5.63 relation Step: `%~>%`(config, config) - ;; 8-reduction.watsup:10.1-12.34 - rule pure {instr* : instr*, instr'* : instr*, z : state}: - `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) - -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) - - ;; 8-reduction.watsup:14.1-16.37 - rule read {instr* : instr*, instr'* : instr*, z : state}: - `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) - -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) + ;; 8-reduction.watsup:760.1-761.51 + rule data.drop {x : idx, z : state}: + `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) - ;; 8-reduction.watsup:317.1-320.61 - rule struct.new {mut^n : mut^n, n : n, si : structinst, val^n : val^n, x : idx, z : state, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) - -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) + ;; 8-reduction.watsup:701.1-702.77 + rule memory.grow-fail {n : n, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) - ;; 8-reduction.watsup:337.1-338.53 - rule struct.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`(z, [TRAP_admininstr])) + ;; 8-reduction.watsup:697.1-699.40 + rule memory.grow-succeed {mi : meminst, n : n, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, (|$mem(z, x).DATA_meminst| / (64 * $Ki)))])) + -- if (mi = $growmemory($mem(z, x), n)) - ;; 8-reduction.watsup:340.1-343.35 - rule struct.set-struct {a : addr, fv : fieldval, i : nat, mut* : mut*, val : val, x : idx, z : state, zt* : storagetype*}: - `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`($with_struct(z, a, i, fv), [])) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + ;; 8-reduction.watsup:687.1-689.48 + rule store-pack-val {b* : byte*, c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (n / 8), b*{b}), [])) + -- if (b*{b} = $ibytes(n, $wrap($size($valtype_numtype(nt)), n, c))) - ;; 8-reduction.watsup:356.1-359.61 - rule array.new_fixed {ai : arrayinst, mut : mut, n : n, val^n : val^n, x : idx, z : state, zt : storagetype}: - `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) + ;; 8-reduction.watsup:683.1-685.51 + rule store-pack-oob {c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:396.1-397.64 - rule array.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + ;; 8-reduction.watsup:679.1-681.29 + rule store-num-val {b* : byte*, c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), ($size($valtype_numtype(nt)) / 8), b*{b}), [])) + -- if (b*{b} = $ntbytes(nt, c)) - ;; 8-reduction.watsup:399.1-401.38 - rule array.set-oob {a : addr, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) - -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:675.1-677.59 + rule store-num-oob {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + -- if (((i + mo.OFFSET_memop) + ($size($valtype_numtype(nt)) / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:403.1-406.31 - rule array.set-array {a : addr, fv : fieldval, i : nat, mut : mut, val : val, x : idx, z : state, zt : storagetype}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) - -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) - -- if (fv = $packval(zt, val)) + ;; 8-reduction.watsup:652.1-653.51 + rule elem.drop {x : idx, z : state}: + `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) - ;; 8-reduction.watsup:549.1-550.56 - rule local.set {val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) + ;; 8-reduction.watsup:593.1-594.80 + rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) - ;; 8-reduction.watsup:561.1-562.58 - rule global.set {val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) + ;; 8-reduction.watsup:589.1-591.46 + rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) + -- if (ti = $growtable($table(z, x), n, ref)) + + ;; 8-reduction.watsup:579.1-581.32 + rule table.set-val {i : nat, ref : ref, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) + -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup:575.1-577.33 rule table.set-oob {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:579.1-581.32 - rule table.set-val {i : nat, ref : ref, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) - -- if (i < |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:561.1-562.58 + rule global.set {val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) - ;; 8-reduction.watsup:589.1-591.46 - rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) - -- if (ti = $growtable($table(z, x), n, ref)) + ;; 8-reduction.watsup:549.1-550.56 + rule local.set {val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) - ;; 8-reduction.watsup:593.1-594.80 - rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) + ;; 8-reduction.watsup:403.1-406.31 + rule array.set-array {a : addr, fv : fieldval, i : nat, mut : mut, val : val, x : idx, z : state, zt : storagetype}: + `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) + -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) + -- if (fv = $packval(zt, val)) - ;; 8-reduction.watsup:652.1-653.51 - rule elem.drop {x : idx, z : state}: - `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) + ;; 8-reduction.watsup:399.1-401.38 + rule array.set-oob {a : addr, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:675.1-677.59 - rule store-num-oob {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if (((i + mo.OFFSET_memop) + ($size($valtype_numtype(nt)) / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:396.1-397.64 + rule array.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) - ;; 8-reduction.watsup:679.1-681.29 - rule store-num-val {b* : byte*, c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), ($size($valtype_numtype(nt)) / 8), b*{b}), [])) - -- if (b*{b} = $ntbytes(nt, c)) + ;; 8-reduction.watsup:356.1-359.61 + rule array.new_fixed {ai : arrayinst, mut : mut, n : n, val^n : val^n, x : idx, z : state, zt : storagetype}: + `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) - ;; 8-reduction.watsup:683.1-685.51 - rule store-pack-oob {c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:340.1-343.35 + rule struct.set-struct {a : addr, fv : fieldval, i : nat, mut* : mut*, val : val, x : idx, z : state, zt* : storagetype*}: + `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`($with_struct(z, a, i, fv), [])) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- if (fv = $packval(zt*{zt}[i], val)) - ;; 8-reduction.watsup:687.1-689.48 - rule store-pack-val {b* : byte*, c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (n / 8), b*{b}), [])) - -- if (b*{b} = $ibytes(n, $wrap($size($valtype_numtype(nt)), n, c))) + ;; 8-reduction.watsup:337.1-338.53 + rule struct.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`(z, [TRAP_admininstr])) - ;; 8-reduction.watsup:697.1-699.40 - rule memory.grow-succeed {mi : meminst, n : n, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, (|$mem(z, x).DATA_meminst| / (64 * $Ki)))])) - -- if (mi = $growmemory($mem(z, x), n)) + ;; 8-reduction.watsup:317.1-320.61 + rule struct.new {mut^n : mut^n, n : n, si : structinst, val^n : val^n, x : idx, z : state, zt^n : storagetype^n}: + `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) + -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) - ;; 8-reduction.watsup:701.1-702.77 - rule memory.grow-fail {n : n, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) + ;; 8-reduction.watsup:14.1-16.37 + rule read {instr* : instr*, instr'* : instr*, z : state}: + `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) + -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) - ;; 8-reduction.watsup:760.1-761.51 - rule data.drop {x : idx, z : state}: - `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) + ;; 8-reduction.watsup:10.1-12.34 + rule pure {instr* : instr*, instr'* : instr*, z : state}: + `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) + -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) ;; 8-reduction.watsup:8.1-8.63 rec { ;; 8-reduction.watsup:8.1-8.63 relation Steps: `%~>*%`(config, config) - ;; 8-reduction.watsup:18.1-19.36 - rule refl {admininstr* : admininstr*, z : state}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) - ;; 8-reduction.watsup:21.1-24.53 rule trans {admininstr* : admininstr*, admininstr' : admininstr, admininstr''* : admininstr*, z : state, z' : state, z'' : state}: `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z'', admininstr''*{admininstr''})) -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z', admininstr'*{})) -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr''})) + + ;; 8-reduction.watsup:18.1-19.36 + rule refl {admininstr* : admininstr*, z : state}: + `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) } ;; 8-reduction.watsup:29.1-29.69 @@ -7870,14 +8013,14 @@ rec { ;; 9-module.watsup:7.1-7.34 def alloctypes : type* -> deftype* - ;; 9-module.watsup:8.1-8.27 - def alloctypes([]) = [] ;; 9-module.watsup:9.1-13.24 def {deftype* : deftype*, deftype'* : deftype*, rectype : rectype, type : type, type'* : type*, x : idx} alloctypes(type'*{type'} :: [type]) = deftype'*{deftype'} :: deftype*{deftype} -- if (deftype'*{deftype'} = $alloctypes(type'*{type'})) -- if (type = TYPE(rectype)) -- if (deftype*{deftype} = $subst_all_deftypes($rolldt(x, rectype), $heaptype_deftype(deftype')*{deftype'})) -- if (x = |deftype'*{deftype'}|) + ;; 9-module.watsup:8.1-8.27 + def alloctypes([]) = [] } ;; 9-module.watsup:15.1-15.60 @@ -7892,12 +8035,12 @@ rec { ;; 9-module.watsup:20.1-20.63 def allocfuncs : (store, moduleinst, func*) -> (store, funcaddr*) - ;; 9-module.watsup:21.1-21.39 - def {mm : moduleinst, s : store} allocfuncs(s, mm, []) = (s, []) ;; 9-module.watsup:22.1-24.51 def {fa : funcaddr, fa'* : funcaddr*, func : func, func'* : func*, mm : moduleinst, s : store, s_1 : store, s_2 : store} allocfuncs(s, mm, [func] :: func'*{func'}) = (s_2, [fa] :: fa'*{fa'}) -- if ((s_1, fa) = $allocfunc(s, mm, func)) -- if ((s_2, fa'*{fa'}) = $allocfuncs(s_1, mm, func'*{func'})) + ;; 9-module.watsup:21.1-21.39 + def {mm : moduleinst, s : store} allocfuncs(s, mm, []) = (s, []) } ;; 9-module.watsup:26.1-26.63 @@ -7911,12 +8054,12 @@ rec { ;; 9-module.watsup:30.1-30.67 def allocglobals : (store, globaltype*, val*) -> (store, globaladdr*) - ;; 9-module.watsup:31.1-31.42 - def {s : store} allocglobals(s, [], []) = (s, []) ;; 9-module.watsup:32.1-34.62 def {ga : globaladdr, ga'* : globaladdr*, globaltype : globaltype, globaltype'* : globaltype*, s : store, s_1 : store, s_2 : store, val : val, val'* : val*} allocglobals(s, [globaltype] :: globaltype'*{globaltype'}, [val] :: val'*{val'}) = (s_2, [ga] :: ga'*{ga'}) -- if ((s_1, ga) = $allocglobal(s, globaltype, val)) -- if ((s_2, ga'*{ga'}) = $allocglobals(s_1, globaltype'*{globaltype'}, val'*{val'})) + ;; 9-module.watsup:31.1-31.42 + def {s : store} allocglobals(s, [], []) = (s, []) } ;; 9-module.watsup:36.1-36.60 @@ -7930,12 +8073,12 @@ rec { ;; 9-module.watsup:40.1-40.64 def alloctables : (store, tabletype*, ref*) -> (store, tableaddr*) - ;; 9-module.watsup:41.1-41.41 - def {s : store} alloctables(s, [], []) = (s, []) ;; 9-module.watsup:42.1-44.60 def {ref : ref, ref'* : ref*, s : store, s_1 : store, s_2 : store, ta : tableaddr, ta'* : tableaddr*, tabletype : tabletype, tabletype'* : tabletype*} alloctables(s, [tabletype] :: tabletype'*{tabletype'}, [ref] :: ref'*{ref'}) = (s_2, [ta] :: ta'*{ta'}) -- if ((s_1, ta) = $alloctable(s, tabletype, ref)) -- if ((s_2, ta'*{ta'}) = $alloctables(s_1, tabletype'*{tabletype'}, ref'*{ref'})) + ;; 9-module.watsup:41.1-41.41 + def {s : store} alloctables(s, [], []) = (s, []) } ;; 9-module.watsup:46.1-46.49 @@ -7949,12 +8092,12 @@ rec { ;; 9-module.watsup:50.1-50.52 def allocmems : (store, memtype*) -> (store, memaddr*) - ;; 9-module.watsup:51.1-51.34 - def {s : store} allocmems(s, []) = (s, []) ;; 9-module.watsup:52.1-54.49 def {ma : memaddr, ma'* : memaddr*, memtype : memtype, memtype'* : memtype*, s : store, s_1 : store, s_2 : store} allocmems(s, [memtype] :: memtype'*{memtype'}) = (s_2, [ma] :: ma'*{ma'}) -- if ((s_1, ma) = $allocmem(s, memtype)) -- if ((s_2, ma'*{ma'}) = $allocmems(s_1, memtype'*{memtype'})) + ;; 9-module.watsup:51.1-51.34 + def {s : store} allocmems(s, []) = (s, []) } ;; 9-module.watsup:56.1-56.57 @@ -7968,12 +8111,12 @@ rec { ;; 9-module.watsup:60.1-60.63 def allocelems : (store, reftype*, ref**) -> (store, elemaddr*) - ;; 9-module.watsup:61.1-61.40 - def {s : store} allocelems(s, [], []) = (s, []) ;; 9-module.watsup:62.1-64.55 def {ea : elemaddr, ea'* : elemaddr*, ref* : ref*, ref'** : ref**, rt : reftype, rt'* : reftype*, s : store, s_1 : store, s_2 : store} allocelems(s, [rt] :: rt'*{rt'}, [ref*{ref}] :: ref'*{ref'}*{ref'}) = (s_2, [ea] :: ea'*{ea'}) -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref})) -- if ((s_2, ea'*{ea'}) = $allocelems(s_2, rt'*{rt'}, ref'*{ref'}*{ref'})) + ;; 9-module.watsup:61.1-61.40 + def {s : store} allocelems(s, [], []) = (s, []) } ;; 9-module.watsup:66.1-66.49 @@ -7987,24 +8130,24 @@ rec { ;; 9-module.watsup:70.1-70.54 def allocdatas : (store, byte**) -> (store, dataaddr*) - ;; 9-module.watsup:71.1-71.35 - def {s : store} allocdatas(s, []) = (s, []) ;; 9-module.watsup:72.1-74.50 def {byte* : byte*, byte'** : byte**, da : dataaddr, da'* : dataaddr*, s : store, s_1 : store, s_2 : store} allocdatas(s, [byte*{byte}] :: byte'*{byte'}*{byte'}) = (s_2, [da] :: da'*{da'}) -- if ((s_1, da) = $allocdata(s, byte*{byte})) -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) + ;; 9-module.watsup:71.1-71.35 + def {s : store} allocdatas(s, []) = (s, []) } ;; 9-module.watsup:79.1-79.83 def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst - ;; 9-module.watsup:80.1-80.95 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} - ;; 9-module.watsup:81.1-81.99 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} - ;; 9-module.watsup:82.1-82.97 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} ;; 9-module.watsup:83.1-83.93 def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} + ;; 9-module.watsup:82.1-82.97 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} + ;; 9-module.watsup:81.1-81.99 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} + ;; 9-module.watsup:80.1-80.95 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} ;; 9-module.watsup:86.1-86.87 def allocmodule : (store, module, externval*, val*, ref*, ref**) -> (store, moduleinst) @@ -8036,27 +8179,27 @@ rec { ;; 9-module.watsup:134.1-134.38 def concat_instr : instr** -> instr* - ;; 9-module.watsup:135.1-135.29 - def concat_instr([]) = [] ;; 9-module.watsup:136.1-136.74 def {instr* : instr*, instr'** : instr**} concat_instr([instr*{instr}] :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) + ;; 9-module.watsup:135.1-135.29 + def concat_instr([]) = [] } ;; 9-module.watsup:138.1-138.33 def runelem : (elem, idx) -> instr* - ;; 9-module.watsup:139.1-139.52 - def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, PASSIVE_elemmode), y) = [] - ;; 9-module.watsup:140.1-140.62 - def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] ;; 9-module.watsup:141.1-142.77 def {expr* : expr*, instr* : instr*, reftype : reftype, x : idx, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, ACTIVE_elemmode(x, instr*{instr})), y) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, |expr*{expr}|) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] + ;; 9-module.watsup:140.1-140.62 + def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] + ;; 9-module.watsup:139.1-139.52 + def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, PASSIVE_elemmode), y) = [] ;; 9-module.watsup:144.1-144.33 def rundata : (data, idx) -> instr* - ;; 9-module.watsup:145.1-145.44 - def {byte* : byte*, y : idx} rundata(`DATA%*%`(byte*{byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup:146.1-147.78 def {byte* : byte*, instr* : instr*, x : idx, y : idx} rundata(`DATA%*%`(byte*{byte}, ACTIVE_datamode(x, instr*{instr})), y) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, |byte*{byte}|) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] + ;; 9-module.watsup:145.1-145.44 + def {byte* : byte*, y : idx} rundata(`DATA%*%`(byte*{byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup:149.1-149.53 def instantiate : (store, module, externval*) -> config @@ -8093,20 +8236,20 @@ rec { ;; A-binary.watsup:47.1-47.24 def utf8 : name -> byte* - ;; A-binary.watsup:48.1-48.44 - def {b : byte, c : c} utf8([c]) = [b] - -- if ((c < 128) /\ (c = b)) - ;; A-binary.watsup:49.1-49.93 - def {b_1 : byte, b_2 : byte, c : c} utf8([c]) = [b_1 b_2] - -- if (((128 <= c) /\ (c < 2048)) /\ (c = (((2 ^ 6) * (b_1 - 192)) + (b_2 - 128)))) - ;; A-binary.watsup:50.1-50.144 - def {b_1 : byte, b_2 : byte, b_3 : byte, c : c} utf8([c]) = [b_1 b_2 b_3] - -- if ((((2048 <= c) /\ (c < 55296)) \/ ((57344 <= c) /\ (c < 65536))) /\ (c = ((((2 ^ 12) * (b_1 - 224)) + ((2 ^ 6) * (b_2 - 128))) + (b_3 - 128)))) + ;; A-binary.watsup:52.1-52.41 + def {c* : c*} utf8(c*{c}) = $concat_bytes($utf8([c])*{c}) ;; A-binary.watsup:51.1-51.145 def {b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte, c : c} utf8([c]) = [b_1 b_2 b_3 b_4] -- if (((65536 <= c) /\ (c < 69632)) /\ (c = (((((2 ^ 18) * (b_1 - 240)) + ((2 ^ 12) * (b_2 - 128))) + ((2 ^ 6) * (b_3 - 128))) + (b_4 - 128)))) - ;; A-binary.watsup:52.1-52.41 - def {c* : c*} utf8(c*{c}) = $concat_bytes($utf8([c])*{c}) + ;; A-binary.watsup:50.1-50.144 + def {b_1 : byte, b_2 : byte, b_3 : byte, c : c} utf8([c]) = [b_1 b_2 b_3] + -- if ((((2048 <= c) /\ (c < 55296)) \/ ((57344 <= c) /\ (c < 65536))) /\ (c = ((((2 ^ 12) * (b_1 - 224)) + ((2 ^ 6) * (b_2 - 128))) + (b_3 - 128)))) + ;; A-binary.watsup:49.1-49.93 + def {b_1 : byte, b_2 : byte, c : c} utf8([c]) = [b_1 b_2] + -- if (((128 <= c) /\ (c < 2048)) /\ (c = (((2 ^ 6) * (b_1 - 192)) + (b_2 - 128)))) + ;; A-binary.watsup:48.1-48.44 + def {b : byte, c : c} utf8([c]) = [b] + -- if ((c < 128) /\ (c = b)) } ;; A-binary.watsup:210.1-210.27 @@ -8120,10 +8263,10 @@ rec { ;; A-binary.watsup:665.1-665.62 def concat_locals : local** -> local* - ;; A-binary.watsup:666.1-666.30 - def concat_locals([]) = [] ;; A-binary.watsup:667.1-667.68 def {loc* : local*, loc'** : local**} concat_locals([loc*{loc}] :: loc'*{loc'}*{loc'}) = loc*{loc} :: $concat_locals(loc'*{loc'}*{loc'}) + ;; A-binary.watsup:666.1-666.30 + def concat_locals([]) = [] } ;; A-binary.watsup:670.1-670.29 @@ -8154,12 +8297,12 @@ rec { ;; 0-aux.watsup:27.1-27.25 def min : (nat, nat) -> nat - ;; 0-aux.watsup:28.1-28.19 - def {j : nat} min(0, j) = 0 - ;; 0-aux.watsup:29.1-29.19 - def {i : nat} min(i, 0) = 0 ;; 0-aux.watsup:30.1-30.38 def {i : nat, j : nat} min((i + 1), (j + 1)) = $min(i, j) + ;; 0-aux.watsup:29.1-29.19 + def {i : nat} min(i, 0) = 0 + ;; 0-aux.watsup:28.1-28.19 + def {j : nat} min(0, j) = 0 } ;; 0-aux.watsup:32.1-32.21 @@ -8167,10 +8310,10 @@ rec { ;; 0-aux.watsup:32.1-32.21 def sum : nat* -> nat - ;; 0-aux.watsup:33.1-33.18 - def sum([]) = 0 ;; 0-aux.watsup:34.1-34.35 def {n : n, n'* : n*} sum([n] :: n'*{n'}) = (n + $sum(n'*{n'})) + ;; 0-aux.watsup:33.1-33.18 + def sum([]) = 0 } ;; 1-syntax.watsup:5.1-5.85 @@ -8208,17 +8351,17 @@ syntax s33 = sN ;; 1-syntax.watsup:35.1-35.21 def signif : N -> nat - ;; 1-syntax.watsup:36.1-36.21 - def signif(32) = 23 ;; 1-syntax.watsup:37.1-37.21 def signif(64) = 52 + ;; 1-syntax.watsup:36.1-36.21 + def signif(32) = 23 ;; 1-syntax.watsup:39.1-39.20 def expon : N -> nat - ;; 1-syntax.watsup:40.1-40.19 - def expon(32) = 8 ;; 1-syntax.watsup:41.1-41.20 def expon(64) = 11 + ;; 1-syntax.watsup:40.1-40.19 + def expon(32) = 8 ;; 1-syntax.watsup:43.1-43.35 def M : N -> nat @@ -8764,14 +8907,14 @@ rec { ;; 2-syntax-aux.watsup:8.1-8.33 def setminus1 : (idx, idx*) -> idx* - ;; 2-syntax-aux.watsup:13.1-13.27 - def {x : idx} setminus1(x, []) = [x] - ;; 2-syntax-aux.watsup:14.1-14.57 - def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = [] - -- if (x = y_1) ;; 2-syntax-aux.watsup:15.1-15.60 def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = $setminus1(x, y*{y}) -- otherwise + ;; 2-syntax-aux.watsup:14.1-14.57 + def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = [] + -- if (x = y_1) + ;; 2-syntax-aux.watsup:13.1-13.27 + def {x : idx} setminus1(x, []) = [x] } ;; 2-syntax-aux.watsup:7.1-7.49 @@ -8779,30 +8922,30 @@ rec { ;; 2-syntax-aux.watsup:7.1-7.49 def setminus : (idx*, idx*) -> idx* - ;; 2-syntax-aux.watsup:10.1-10.29 - def {y* : idx*} setminus([], y*{y}) = [] ;; 2-syntax-aux.watsup:11.1-11.66 def {x* : idx*, x_1 : idx, y* : idx*} setminus([x_1] :: x*{x}, y*{y}) = $setminus1(x_1, y*{y}) :: $setminus(x*{x}, y*{y}) + ;; 2-syntax-aux.watsup:10.1-10.29 + def {y* : idx*} setminus([], y*{y}) = [] } ;; 2-syntax-aux.watsup:20.1-20.68 def free_dataidx_instr : instr -> dataidx* - ;; 2-syntax-aux.watsup:21.1-21.45 - def {x : idx, y : idx} free_dataidx_instr(MEMORY.INIT_instr(x, y)) = [y] - ;; 2-syntax-aux.watsup:22.1-22.41 - def {x : idx} free_dataidx_instr(DATA.DROP_instr(x)) = [x] ;; 2-syntax-aux.watsup:23.1-23.34 def {in : instr} free_dataidx_instr(in) = [] + ;; 2-syntax-aux.watsup:22.1-22.41 + def {x : idx} free_dataidx_instr(DATA.DROP_instr(x)) = [x] + ;; 2-syntax-aux.watsup:21.1-21.45 + def {x : idx, y : idx} free_dataidx_instr(MEMORY.INIT_instr(x, y)) = [y] ;; 2-syntax-aux.watsup:25.1-25.70 rec { ;; 2-syntax-aux.watsup:25.1-25.70 def free_dataidx_instrs : instr* -> dataidx* - ;; 2-syntax-aux.watsup:26.1-26.36 - def free_dataidx_instrs([]) = [] ;; 2-syntax-aux.watsup:27.1-27.99 def {instr : instr, instr'* : instr*} free_dataidx_instrs([instr] :: instr'*{instr'}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr'}) + ;; 2-syntax-aux.watsup:26.1-26.36 + def free_dataidx_instrs([]) = [] } ;; 2-syntax-aux.watsup:29.1-29.66 @@ -8820,10 +8963,10 @@ rec { ;; 2-syntax-aux.watsup:35.1-35.68 def free_dataidx_funcs : func* -> dataidx* - ;; 2-syntax-aux.watsup:36.1-36.35 - def free_dataidx_funcs([]) = [] ;; 2-syntax-aux.watsup:37.1-37.92 def {func : func, func'* : func*} free_dataidx_funcs([func] :: func'*{func'}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func'}) + ;; 2-syntax-aux.watsup:36.1-36.35 + def free_dataidx_funcs([]) = [] } ;; 2-syntax-aux.watsup:46.1-46.59 @@ -8831,67 +8974,67 @@ rec { ;; 2-syntax-aux.watsup:46.1-46.59 def concat_bytes : byte** -> byte* - ;; 2-syntax-aux.watsup:47.1-47.29 - def concat_bytes([]) = [] ;; 2-syntax-aux.watsup:48.1-48.58 def {b* : byte*, b'** : byte**} concat_bytes([b*{b}] :: b'*{b'}*{b'}) = b*{b} :: $concat_bytes(b'*{b'}*{b'}) + ;; 2-syntax-aux.watsup:47.1-47.29 + def concat_bytes([]) = [] } ;; 2-syntax-aux.watsup:59.1-59.55 def size : valtype -> nat? - ;; 2-syntax-aux.watsup:60.1-60.20 - def size(I32_valtype) = ?(32) - ;; 2-syntax-aux.watsup:61.1-61.20 - def size(I64_valtype) = ?(64) - ;; 2-syntax-aux.watsup:62.1-62.20 - def size(F32_valtype) = ?(32) - ;; 2-syntax-aux.watsup:63.1-63.20 - def size(F64_valtype) = ?(64) ;; 2-syntax-aux.watsup:64.1-64.22 def size(V128_valtype) = ?(128) + ;; 2-syntax-aux.watsup:63.1-63.20 + def size(F64_valtype) = ?(64) + ;; 2-syntax-aux.watsup:62.1-62.20 + def size(F32_valtype) = ?(32) + ;; 2-syntax-aux.watsup:61.1-61.20 + def size(I64_valtype) = ?(64) + ;; 2-syntax-aux.watsup:60.1-60.20 + def size(I32_valtype) = ?(32) def {x : valtype} size(x) = ?() ;; 2-syntax-aux.watsup:66.1-66.50 def packedsize : packedtype -> nat - ;; 2-syntax-aux.watsup:67.1-67.24 - def packedsize(I8_packedtype) = 8 ;; 2-syntax-aux.watsup:68.1-68.26 def packedsize(I16_packedtype) = 16 + ;; 2-syntax-aux.watsup:67.1-67.24 + def packedsize(I8_packedtype) = 8 ;; 2-syntax-aux.watsup:70.1-70.52 def storagesize : storagetype -> nat - ;; 2-syntax-aux.watsup:71.1-71.43 - def {valtype : valtype} storagesize($storagetype_valtype(valtype)) = !($size(valtype)) ;; 2-syntax-aux.watsup:72.1-72.55 def {packedtype : packedtype} storagesize($storagetype_packedtype(packedtype)) = $packedsize(packedtype) + ;; 2-syntax-aux.watsup:71.1-71.43 + def {valtype : valtype} storagesize($storagetype_valtype(valtype)) = !($size(valtype)) ;; 2-syntax-aux.watsup:77.1-77.62 def unpacktype : storagetype -> valtype - ;; 2-syntax-aux.watsup:78.1-78.35 - def {valtype : valtype} unpacktype($storagetype_valtype(valtype)) = valtype ;; 2-syntax-aux.watsup:79.1-79.34 def {packedtype : packedtype} unpacktype($storagetype_packedtype(packedtype)) = I32_valtype + ;; 2-syntax-aux.watsup:78.1-78.35 + def {valtype : valtype} unpacktype($storagetype_valtype(valtype)) = valtype ;; 2-syntax-aux.watsup:81.1-81.65 def unpacknumtype : storagetype -> numtype - ;; 2-syntax-aux.watsup:82.1-82.38 - def {numtype : numtype} unpacknumtype($storagetype_numtype(numtype)) = numtype ;; 2-syntax-aux.watsup:83.1-83.37 def {packedtype : packedtype} unpacknumtype($storagetype_packedtype(packedtype)) = I32_numtype + ;; 2-syntax-aux.watsup:82.1-82.38 + def {numtype : numtype} unpacknumtype($storagetype_numtype(numtype)) = numtype ;; 2-syntax-aux.watsup:85.1-85.51 def sxfield : storagetype -> sx? - ;; 2-syntax-aux.watsup:86.1-86.28 - def {valtype : valtype} sxfield($storagetype_valtype(valtype)) = ?() ;; 2-syntax-aux.watsup:87.1-87.29 def {packedtype : packedtype} sxfield($storagetype_packedtype(packedtype)) = ?(S_sx) + ;; 2-syntax-aux.watsup:86.1-86.28 + def {valtype : valtype} sxfield($storagetype_valtype(valtype)) = ?() ;; 2-syntax-aux.watsup:92.1-92.59 def diffrt : (reftype, reftype) -> reftype - ;; 2-syntax-aux.watsup:94.1-94.64 - def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) = REF_reftype(`NULL%?`(?()), ht_1) ;; 2-syntax-aux.watsup:95.1-95.65 def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?()), ht_2)) = REF_reftype(nul_1, ht_1) + ;; 2-syntax-aux.watsup:94.1-94.64 + def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) = REF_reftype(`NULL%?`(?()), ht_1) ;; 2-syntax-aux.watsup:100.1-100.42 syntax typevar = @@ -8912,14 +9055,14 @@ rec { ;; 2-syntax-aux.watsup:109.1-109.92 def subst_typevar : (typevar, typevar*, heaptype*) -> heaptype - ;; 2-syntax-aux.watsup:134.1-134.38 - def {xx : typevar} subst_typevar(xx, [], []) = $heaptype_typevar(xx) - ;; 2-syntax-aux.watsup:135.1-135.95 - def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 - -- if (xx = xx_1) ;; 2-syntax-aux.watsup:136.1-136.92 def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = $subst_typevar(xx, xx'*{xx'}, ht'*{ht'}) -- otherwise + ;; 2-syntax-aux.watsup:135.1-135.95 + def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 + -- if (xx = xx_1) + ;; 2-syntax-aux.watsup:134.1-134.38 + def {xx : typevar} subst_typevar(xx, [], []) = $heaptype_typevar(xx) } ;; 2-syntax-aux.watsup:111.1-111.92 @@ -8942,13 +9085,13 @@ rec { ;; 2-syntax-aux.watsup:113.1-113.92 def subst_heaptype : (heaptype, typevar*, heaptype*) -> heaptype - ;; 2-syntax-aux.watsup:141.1-141.67 - def {ht* : heaptype*, xx* : typevar*, xx' : typevar} subst_heaptype($heaptype_typevar(xx'), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) - ;; 2-syntax-aux.watsup:142.1-142.65 - def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_heaptype($heaptype_deftype(dt), xx*{xx}, ht*{ht}) = $heaptype_deftype($subst_deftype(dt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:143.1-143.55 def {ht* : heaptype*, ht' : heaptype, xx* : typevar*} subst_heaptype(ht', xx*{xx}, ht*{ht}) = ht' -- otherwise + ;; 2-syntax-aux.watsup:142.1-142.65 + def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_heaptype($heaptype_deftype(dt), xx*{xx}, ht*{ht}) = $heaptype_deftype($subst_deftype(dt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:141.1-141.67 + def {ht* : heaptype*, xx* : typevar*, xx' : typevar} subst_heaptype($heaptype_typevar(xx'), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) ;; 2-syntax-aux.watsup:114.1-114.92 def subst_reftype : (reftype, typevar*, heaptype*) -> reftype @@ -8957,21 +9100,21 @@ def subst_reftype : (reftype, typevar*, heaptype*) -> reftype ;; 2-syntax-aux.watsup:115.1-115.92 def subst_valtype : (valtype, typevar*, heaptype*) -> valtype - ;; 2-syntax-aux.watsup:147.1-147.64 - def {ht* : heaptype*, nt : numtype, xx* : typevar*} subst_valtype($valtype_numtype(nt), xx*{xx}, ht*{ht}) = $valtype_numtype($subst_numtype(nt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:148.1-148.64 - def {ht* : heaptype*, vt : vectype, xx* : typevar*} subst_valtype($valtype_vectype(vt), xx*{xx}, ht*{ht}) = $valtype_vectype($subst_vectype(vt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:149.1-149.64 - def {ht* : heaptype*, rt : reftype, xx* : typevar*} subst_valtype($valtype_reftype(rt), xx*{xx}, ht*{ht}) = $valtype_reftype($subst_reftype(rt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:150.1-150.40 def {ht* : heaptype*, xx* : typevar*} subst_valtype(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + ;; 2-syntax-aux.watsup:149.1-149.64 + def {ht* : heaptype*, rt : reftype, xx* : typevar*} subst_valtype($valtype_reftype(rt), xx*{xx}, ht*{ht}) = $valtype_reftype($subst_reftype(rt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:148.1-148.64 + def {ht* : heaptype*, vt : vectype, xx* : typevar*} subst_valtype($valtype_vectype(vt), xx*{xx}, ht*{ht}) = $valtype_vectype($subst_vectype(vt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:147.1-147.64 + def {ht* : heaptype*, nt : numtype, xx* : typevar*} subst_valtype($valtype_numtype(nt), xx*{xx}, ht*{ht}) = $valtype_numtype($subst_numtype(nt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:118.1-118.92 def subst_storagetype : (storagetype, typevar*, heaptype*) -> storagetype - ;; 2-syntax-aux.watsup:154.1-154.66 - def {ht* : heaptype*, t : valtype, xx* : typevar*} subst_storagetype($storagetype_valtype(t), xx*{xx}, ht*{ht}) = $storagetype_valtype($subst_valtype(t, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:155.1-155.71 def {ht* : heaptype*, pt : packedtype, xx* : typevar*} subst_storagetype($storagetype_packedtype(pt), xx*{xx}, ht*{ht}) = $storagetype_packedtype($subst_packedtype(pt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:154.1-154.66 + def {ht* : heaptype*, t : valtype, xx* : typevar*} subst_storagetype($storagetype_valtype(t), xx*{xx}, ht*{ht}) = $storagetype_valtype($subst_valtype(t, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:119.1-119.92 def subst_fieldtype : (fieldtype, typevar*, heaptype*) -> fieldtype @@ -8980,19 +9123,19 @@ def subst_fieldtype : (fieldtype, typevar*, heaptype*) -> fieldtype ;; 2-syntax-aux.watsup:121.1-121.92 def subst_comptype : (comptype, typevar*, heaptype*) -> comptype - ;; 2-syntax-aux.watsup:159.1-159.85 - def {ht* : heaptype*, xx* : typevar*, yt* : fieldtype*} subst_comptype(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) - ;; 2-syntax-aux.watsup:160.1-160.81 - def {ht* : heaptype*, xx* : typevar*, yt : fieldtype} subst_comptype(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:161.1-161.78 def {ft : functype, ht* : heaptype*, xx* : typevar*} subst_comptype(FUNC_comptype(ft), xx*{xx}, ht*{ht}) = FUNC_comptype($subst_functype(ft, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:160.1-160.81 + def {ht* : heaptype*, xx* : typevar*, yt : fieldtype} subst_comptype(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:159.1-159.85 + def {ht* : heaptype*, xx* : typevar*, yt* : fieldtype*} subst_comptype(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) ;; 2-syntax-aux.watsup:122.1-122.92 def subst_subtype : (subtype, typevar*, heaptype*) -> subtype - ;; 2-syntax-aux.watsup:163.1-164.76 - def {ct : comptype, fin : fin, ht* : heaptype*, xx* : typevar*, y* : idx*} subst_subtype(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:165.1-166.73 def {ct : comptype, fin : fin, ht* : heaptype*, ht'* : heaptype*, xx* : typevar*} subst_subtype(SUBD_subtype(fin, ht'*{ht'}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx}, ht*{ht})*{ht'}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:163.1-164.76 + def {ct : comptype, fin : fin, ht* : heaptype*, xx* : typevar*, y* : idx*} subst_subtype(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:123.1-123.92 def subst_rectype : (rectype, typevar*, heaptype*) -> rectype @@ -9027,14 +9170,14 @@ def subst_memtype : (memtype, typevar*, heaptype*) -> memtype ;; 2-syntax-aux.watsup:131.1-131.92 def subst_externtype : (externtype, typevar*, heaptype*) -> externtype - ;; 2-syntax-aux.watsup:177.1-177.79 - def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_externtype(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:178.1-178.86 - def {gt : globaltype, ht* : heaptype*, xx* : typevar*} subst_externtype(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:179.1-179.83 - def {ht* : heaptype*, tt : tabletype, xx* : typevar*} subst_externtype(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:180.1-180.77 def {ht* : heaptype*, mt : memtype, xx* : typevar*} subst_externtype(MEM_externtype(mt), xx*{xx}, ht*{ht}) = MEM_externtype($subst_memtype(mt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:179.1-179.83 + def {ht* : heaptype*, tt : tabletype, xx* : typevar*} subst_externtype(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:178.1-178.86 + def {gt : globaltype, ht* : heaptype*, xx* : typevar*} subst_externtype(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:177.1-177.79 + def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_externtype(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:183.1-183.74 def subst_all_reftype : (reftype, heaptype*) -> reftype @@ -9051,10 +9194,10 @@ rec { ;; 2-syntax-aux.watsup:189.1-189.77 def subst_all_deftypes : (deftype*, heaptype*) -> deftype* - ;; 2-syntax-aux.watsup:191.1-191.40 - def {ht* : heaptype*} subst_all_deftypes([], ht*{ht}) = [] ;; 2-syntax-aux.watsup:192.1-192.101 def {dt* : deftype*, dt_1 : deftype, ht* : heaptype*} subst_all_deftypes([dt_1] :: dt*{dt}, ht*{ht}) = [$subst_all_deftype(dt_1, ht*{ht})] :: $subst_all_deftypes(dt*{dt}, ht*{ht}) + ;; 2-syntax-aux.watsup:191.1-191.40 + def {ht* : heaptype*} subst_all_deftypes([], ht*{ht}) = [] } ;; 2-syntax-aux.watsup:197.1-197.65 @@ -9098,13 +9241,13 @@ rec { ;; 2-syntax-aux.watsup:221.1-221.64 def funcsxt : externtype* -> deftype* - ;; 2-syntax-aux.watsup:226.1-226.24 - def funcsxt([]) = [] - ;; 2-syntax-aux.watsup:227.1-227.47 - def {dt : deftype, et* : externtype*} funcsxt([FUNC_externtype(dt)] :: et*{et}) = [dt] :: $funcsxt(et*{et}) ;; 2-syntax-aux.watsup:228.1-228.59 def {et* : externtype*, externtype : externtype} funcsxt([externtype] :: et*{et}) = $funcsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:227.1-227.47 + def {dt : deftype, et* : externtype*} funcsxt([FUNC_externtype(dt)] :: et*{et}) = [dt] :: $funcsxt(et*{et}) + ;; 2-syntax-aux.watsup:226.1-226.24 + def funcsxt([]) = [] } ;; 2-syntax-aux.watsup:222.1-222.66 @@ -9112,13 +9255,13 @@ rec { ;; 2-syntax-aux.watsup:222.1-222.66 def globalsxt : externtype* -> globaltype* - ;; 2-syntax-aux.watsup:230.1-230.26 - def globalsxt([]) = [] - ;; 2-syntax-aux.watsup:231.1-231.53 - def {et* : externtype*, gt : globaltype} globalsxt([GLOBAL_externtype(gt)] :: et*{et}) = [gt] :: $globalsxt(et*{et}) ;; 2-syntax-aux.watsup:232.1-232.63 def {et* : externtype*, externtype : externtype} globalsxt([externtype] :: et*{et}) = $globalsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:231.1-231.53 + def {et* : externtype*, gt : globaltype} globalsxt([GLOBAL_externtype(gt)] :: et*{et}) = [gt] :: $globalsxt(et*{et}) + ;; 2-syntax-aux.watsup:230.1-230.26 + def globalsxt([]) = [] } ;; 2-syntax-aux.watsup:223.1-223.65 @@ -9126,13 +9269,13 @@ rec { ;; 2-syntax-aux.watsup:223.1-223.65 def tablesxt : externtype* -> tabletype* - ;; 2-syntax-aux.watsup:234.1-234.25 - def tablesxt([]) = [] - ;; 2-syntax-aux.watsup:235.1-235.50 - def {et* : externtype*, tt : tabletype} tablesxt([TABLE_externtype(tt)] :: et*{et}) = [tt] :: $tablesxt(et*{et}) ;; 2-syntax-aux.watsup:236.1-236.61 def {et* : externtype*, externtype : externtype} tablesxt([externtype] :: et*{et}) = $tablesxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:235.1-235.50 + def {et* : externtype*, tt : tabletype} tablesxt([TABLE_externtype(tt)] :: et*{et}) = [tt] :: $tablesxt(et*{et}) + ;; 2-syntax-aux.watsup:234.1-234.25 + def tablesxt([]) = [] } ;; 2-syntax-aux.watsup:224.1-224.63 @@ -9140,13 +9283,13 @@ rec { ;; 2-syntax-aux.watsup:224.1-224.63 def memsxt : externtype* -> memtype* - ;; 2-syntax-aux.watsup:238.1-238.23 - def memsxt([]) = [] - ;; 2-syntax-aux.watsup:239.1-239.44 - def {et* : externtype*, mt : memtype} memsxt([MEM_externtype(mt)] :: et*{et}) = [mt] :: $memsxt(et*{et}) ;; 2-syntax-aux.watsup:240.1-240.57 def {et* : externtype*, externtype : externtype} memsxt([externtype] :: et*{et}) = $memsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:239.1-239.44 + def {et* : externtype*, mt : memtype} memsxt([MEM_externtype(mt)] :: et*{et}) = [mt] :: $memsxt(et*{et}) + ;; 2-syntax-aux.watsup:238.1-238.23 + def memsxt([]) = [] } ;; 2-syntax-aux.watsup:249.1-249.33 @@ -9159,12 +9302,12 @@ def s33_to_u32 : s33 -> u32 ;; 3-numerics.watsup:12.1-12.57 def signed : (N, nat) -> int - ;; 3-numerics.watsup:13.1-13.54 - def {N : N, i : nat} signed(N, i) = (i <: int) - -- if (0 <= (2 ^ (N - 1))) ;; 3-numerics.watsup:14.1-14.60 def {N : N, i : nat} signed(N, i) = ((i - (2 ^ N)) <: int) -- if (((2 ^ (N - 1)) <= i) /\ (i < (2 ^ N))) + ;; 3-numerics.watsup:13.1-13.54 + def {N : N, i : nat} signed(N, i) = (i <: int) + -- if (0 <= (2 ^ (N - 1))) ;; 3-numerics.watsup:16.1-16.63 def invsigned : (N, int) -> nat @@ -9592,45 +9735,45 @@ def inst_reftype : (moduleinst, reftype) -> reftype ;; 5-runtime-aux.watsup:19.1-19.52 def default : valtype -> val? - ;; 5-runtime-aux.watsup:21.1-21.34 - def default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) - ;; 5-runtime-aux.watsup:22.1-22.34 - def default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) - ;; 5-runtime-aux.watsup:23.1-23.34 - def default(F32_valtype) = ?(CONST_val(F32_numtype, 0)) - ;; 5-runtime-aux.watsup:24.1-24.34 - def default(F64_valtype) = ?(CONST_val(F64_numtype, 0)) - ;; 5-runtime-aux.watsup:25.1-25.42 - def {ht : heaptype} default(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) ;; 5-runtime-aux.watsup:26.1-26.31 def {ht : heaptype} default(REF_valtype(`NULL%?`(?()), ht)) = ?() + ;; 5-runtime-aux.watsup:25.1-25.42 + def {ht : heaptype} default(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) + ;; 5-runtime-aux.watsup:24.1-24.34 + def default(F64_valtype) = ?(CONST_val(F64_numtype, 0)) + ;; 5-runtime-aux.watsup:23.1-23.34 + def default(F32_valtype) = ?(CONST_val(F32_numtype, 0)) + ;; 5-runtime-aux.watsup:22.1-22.34 + def default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) + ;; 5-runtime-aux.watsup:21.1-21.34 + def default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) ;; 5-runtime-aux.watsup:31.1-31.73 def packval : (storagetype, val) -> fieldval - ;; 5-runtime-aux.watsup:34.1-34.27 - def {t : valtype, val : val} packval($storagetype_valtype(t), val) = $fieldval_val(val) ;; 5-runtime-aux.watsup:35.1-35.70 def {i : nat, pt : packedtype} packval($storagetype_packedtype(pt), CONST_val(I32_numtype, i)) = PACK_fieldval(pt, $wrap(32, $packedsize(pt), i)) + ;; 5-runtime-aux.watsup:34.1-34.27 + def {t : valtype, val : val} packval($storagetype_valtype(t), val) = $fieldval_val(val) ;; 5-runtime-aux.watsup:32.1-32.83 def unpackval : (storagetype, sx?, fieldval) -> val - ;; 5-runtime-aux.watsup:37.1-37.34 - def {t : valtype, val : val} unpackval($storagetype_valtype(t), ?(), $fieldval_val(val)) = val ;; 5-runtime-aux.watsup:38.1-38.79 def {i : nat, pt : packedtype, sx : sx} unpackval($storagetype_packedtype(pt), ?(sx), PACK_fieldval(pt, i)) = CONST_val(I32_numtype, $ext($packedsize(pt), 32, sx, i)) + ;; 5-runtime-aux.watsup:37.1-37.34 + def {t : valtype, val : val} unpackval($storagetype_valtype(t), ?(), $fieldval_val(val)) = val ;; 5-runtime-aux.watsup:43.1-43.62 rec { ;; 5-runtime-aux.watsup:43.1-43.62 def funcsxv : externval* -> funcaddr* - ;; 5-runtime-aux.watsup:48.1-48.24 - def funcsxv([]) = [] - ;; 5-runtime-aux.watsup:49.1-49.47 - def {fa : funcaddr, xv* : externval*} funcsxv([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) ;; 5-runtime-aux.watsup:50.1-50.58 def {externval : externval, xv* : externval*} funcsxv([externval] :: xv*{xv}) = $funcsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:49.1-49.47 + def {fa : funcaddr, xv* : externval*} funcsxv([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:48.1-48.24 + def funcsxv([]) = [] } ;; 5-runtime-aux.watsup:44.1-44.64 @@ -9638,13 +9781,13 @@ rec { ;; 5-runtime-aux.watsup:44.1-44.64 def globalsxv : externval* -> globaladdr* - ;; 5-runtime-aux.watsup:52.1-52.26 - def globalsxv([]) = [] - ;; 5-runtime-aux.watsup:53.1-53.53 - def {ga : globaladdr, xv* : externval*} globalsxv([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) ;; 5-runtime-aux.watsup:54.1-54.62 def {externval : externval, xv* : externval*} globalsxv([externval] :: xv*{xv}) = $globalsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:53.1-53.53 + def {ga : globaladdr, xv* : externval*} globalsxv([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:52.1-52.26 + def globalsxv([]) = [] } ;; 5-runtime-aux.watsup:45.1-45.63 @@ -9652,13 +9795,13 @@ rec { ;; 5-runtime-aux.watsup:45.1-45.63 def tablesxv : externval* -> tableaddr* - ;; 5-runtime-aux.watsup:56.1-56.25 - def tablesxv([]) = [] - ;; 5-runtime-aux.watsup:57.1-57.50 - def {ta : tableaddr, xv* : externval*} tablesxv([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) ;; 5-runtime-aux.watsup:58.1-58.60 def {externval : externval, xv* : externval*} tablesxv([externval] :: xv*{xv}) = $tablesxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:57.1-57.50 + def {ta : tableaddr, xv* : externval*} tablesxv([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) + ;; 5-runtime-aux.watsup:56.1-56.25 + def tablesxv([]) = [] } ;; 5-runtime-aux.watsup:46.1-46.61 @@ -9666,13 +9809,13 @@ rec { ;; 5-runtime-aux.watsup:46.1-46.61 def memsxv : externval* -> memaddr* - ;; 5-runtime-aux.watsup:60.1-60.23 - def memsxv([]) = [] - ;; 5-runtime-aux.watsup:61.1-61.44 - def {ma : memaddr, xv* : externval*} memsxv([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) ;; 5-runtime-aux.watsup:62.1-62.56 def {externval : externval, xv* : externval*} memsxv([externval] :: xv*{xv}) = $memsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:61.1-61.44 + def {ma : memaddr, xv* : externval*} memsxv([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:60.1-60.23 + def memsxv([]) = [] } ;; 5-runtime-aux.watsup:72.1-72.57 @@ -9874,10 +10017,10 @@ rec { ;; 6-typing.watsup:26.1-26.86 def with_locals : (context, localidx*, localtype*) -> context - ;; 6-typing.watsup:28.1-28.34 - def {C : context} with_locals(C, [], []) = C ;; 6-typing.watsup:29.1-29.85 def {C : context, lt* : localtype*, lt_1 : localtype, x* : idx*, x_1 : idx} with_locals(C, [x_1] :: x*{x}, [lt_1] :: lt*{lt}) = $with_locals(C[LOCAL_context[x_1] = lt_1], x*{x}, lt*{lt}) + ;; 6-typing.watsup:28.1-28.34 + def {C : context} with_locals(C, [], []) = C } ;; 6-typing.watsup:33.1-33.65 @@ -9885,11 +10028,11 @@ rec { ;; 6-typing.watsup:33.1-33.65 def clostypes : deftype* -> deftype* - ;; 6-typing.watsup:37.1-37.26 - def clostypes([]) = [] ;; 6-typing.watsup:38.1-38.93 def {dt* : deftype*, dt'* : deftype*, dt_N : deftype} clostypes(dt*{dt} :: [dt_N]) = dt'*{dt'} :: [$subst_all_deftype(dt_N, $heaptype_deftype(dt')*{dt'})] -- if (dt'*{dt'} = $clostypes(dt*{dt})) + ;; 6-typing.watsup:37.1-37.26 + def clostypes([]) = [] } ;; 6-typing.watsup:32.1-32.65 @@ -9912,19 +10055,19 @@ relation Vectype_ok: `%|-%:OK`(context, vectype) ;; 6-typing.watsup:49.1-49.72 relation Heaptype_ok: `%|-%:OK`(context, heaptype) - ;; 6-typing.watsup:60.1-61.24 - rule abs {C : context, absheaptype : absheaptype}: - `%|-%:OK`(C, $heaptype_absheaptype(absheaptype)) + ;; 6-typing.watsup:67.1-69.22 + rule rec {C : context, i : nat, st : subtype}: + `%|-%:OK`(C, REC_heaptype(i)) + -- if (C.REC_context[i] = st) ;; 6-typing.watsup:63.1-65.23 rule typeidx {C : context, dt : deftype, x : idx}: `%|-%:OK`(C, _IDX_heaptype(x)) -- if (C.TYPE_context[x] = dt) - ;; 6-typing.watsup:67.1-69.22 - rule rec {C : context, i : nat, st : subtype}: - `%|-%:OK`(C, REC_heaptype(i)) - -- if (C.REC_context[i] = st) + ;; 6-typing.watsup:60.1-61.24 + rule abs {C : context, absheaptype : absheaptype}: + `%|-%:OK`(C, $heaptype_absheaptype(absheaptype)) ;; 6-typing.watsup:50.1-50.71 relation Reftype_ok: `%|-%:OK`(context, reftype) @@ -9935,24 +10078,24 @@ relation Reftype_ok: `%|-%:OK`(context, reftype) ;; 6-typing.watsup:51.1-51.71 relation Valtype_ok: `%|-%:OK`(context, valtype) - ;; 6-typing.watsup:75.1-77.35 - rule num {C : context, numtype : numtype}: - `%|-%:OK`(C, $valtype_numtype(numtype)) - -- Numtype_ok: `%|-%:OK`(C, numtype) - - ;; 6-typing.watsup:79.1-81.35 - rule vec {C : context, vectype : vectype}: - `%|-%:OK`(C, $valtype_vectype(vectype)) - -- Vectype_ok: `%|-%:OK`(C, vectype) + ;; 6-typing.watsup:87.1-88.16 + rule bot {C : context}: + `%|-%:OK`(C, BOT_valtype) ;; 6-typing.watsup:83.1-85.35 rule ref {C : context, reftype : reftype}: `%|-%:OK`(C, $valtype_reftype(reftype)) -- Reftype_ok: `%|-%:OK`(C, reftype) - ;; 6-typing.watsup:87.1-88.16 - rule bot {C : context}: - `%|-%:OK`(C, BOT_valtype) + ;; 6-typing.watsup:79.1-81.35 + rule vec {C : context, vectype : vectype}: + `%|-%:OK`(C, $valtype_vectype(vectype)) + -- Vectype_ok: `%|-%:OK`(C, vectype) + + ;; 6-typing.watsup:75.1-77.35 + rule num {C : context, numtype : numtype}: + `%|-%:OK`(C, $valtype_numtype(numtype)) + -- Numtype_ok: `%|-%:OK`(C, numtype) ;; 6-typing.watsup:93.1-93.74 relation Resulttype_ok: `%|-%:OK`(context, resulttype) @@ -9986,16 +10129,16 @@ relation Packedtype_ok: `%|-%:OK`(context, packedtype) ;; 6-typing.watsup:114.1-114.77 relation Storagetype_ok: `%|-%:OK`(context, storagetype) - ;; 6-typing.watsup:131.1-133.35 - rule val {C : context, valtype : valtype}: - `%|-%:OK`(C, $storagetype_valtype(valtype)) - -- Valtype_ok: `%|-%:OK`(C, valtype) - ;; 6-typing.watsup:135.1-137.41 rule packed {C : context, packedtype : packedtype}: `%|-%:OK`(C, $storagetype_packedtype(packedtype)) -- Packedtype_ok: `%|-%:OK`(C, packedtype) + ;; 6-typing.watsup:131.1-133.35 + rule val {C : context, valtype : valtype}: + `%|-%:OK`(C, $storagetype_valtype(valtype)) + -- Valtype_ok: `%|-%:OK`(C, valtype) + ;; 6-typing.watsup:113.1-113.75 relation Fieldtype_ok: `%|-%:OK`(context, fieldtype) ;; 6-typing.watsup:139.1-141.34 @@ -10013,20 +10156,20 @@ relation Functype_ok: `%|-%:OK`(context, functype) ;; 6-typing.watsup:115.1-115.74 relation Comptype_ok: `%|-%:OK`(context, comptype) - ;; 6-typing.watsup:144.1-146.35 - rule struct {C : context, yt* : fieldtype*}: - `%|-%:OK`(C, STRUCT_comptype(yt*{yt})) - -- (Fieldtype_ok: `%|-%:OK`(C, yt))*{yt} + ;; 6-typing.watsup:152.1-154.31 + rule func {C : context, ft : functype}: + `%|-%:OK`(C, FUNC_comptype(ft)) + -- Functype_ok: `%|-%:OK`(C, ft) ;; 6-typing.watsup:148.1-150.32 rule array {C : context, yt : fieldtype}: `%|-%:OK`(C, ARRAY_comptype(yt)) -- Fieldtype_ok: `%|-%:OK`(C, yt) - ;; 6-typing.watsup:152.1-154.31 - rule func {C : context, ft : functype}: - `%|-%:OK`(C, FUNC_comptype(ft)) - -- Functype_ok: `%|-%:OK`(C, ft) + ;; 6-typing.watsup:144.1-146.35 + rule struct {C : context, yt* : fieldtype*}: + `%|-%:OK`(C, STRUCT_comptype(yt*{yt})) + -- (Fieldtype_ok: `%|-%:OK`(C, yt))*{yt} ;; 6-typing.watsup:391.1-391.91 relation Packedtype_sub: `%|-%<:%`(context, packedtype, packedtype) @@ -10045,113 +10188,113 @@ rec { ;; 6-typing.watsup:125.1-125.75 relation Deftype_sub: `%|-%<:%`(context, deftype, deftype) - ;; 6-typing.watsup:434.1-436.58 - rule refl {C : context, deftype_1 : deftype, deftype_2 : deftype}: - `%|-%<:%`(C, deftype_1, deftype_2) - -- if ($clostype(C, deftype_1) = $clostype(C, deftype_2)) - ;; 6-typing.watsup:438.1-441.40 rule super {C : context, ct : comptype, deftype_1 : deftype, deftype_2 : deftype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*}: `%|-%<:%`(C, deftype_1, deftype_2) -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) -- Heaptype_sub: `%|-%<:%`(C, ht, $heaptype_deftype(deftype_2)) + ;; 6-typing.watsup:434.1-436.58 + rule refl {C : context, deftype_1 : deftype, deftype_2 : deftype}: + `%|-%<:%`(C, deftype_1, deftype_2) + -- if ($clostype(C, deftype_1) = $clostype(C, deftype_2)) + ;; 6-typing.watsup:271.1-271.79 relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) - ;; 6-typing.watsup:282.1-283.28 - rule refl {C : context, heaptype : heaptype}: - `%|-%<:%`(C, heaptype, heaptype) + ;; 6-typing.watsup:343.1-344.23 + rule bot {C : context, heaptype : heaptype}: + `%|-%<:%`(C, BOT_heaptype, heaptype) - ;; 6-typing.watsup:285.1-289.48 - rule trans {C : context, heaptype' : heaptype, heaptype_1 : heaptype, heaptype_2 : heaptype}: - `%|-%<:%`(C, heaptype_1, heaptype_2) - -- Heaptype_ok: `%|-%:OK`(C, heaptype') - -- Heaptype_sub: `%|-%<:%`(C, heaptype_1, heaptype') - -- Heaptype_sub: `%|-%<:%`(C, heaptype', heaptype_2) + ;; 6-typing.watsup:339.1-341.43 + rule noextern {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NOEXTERN_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, EXTERN_heaptype) - ;; 6-typing.watsup:291.1-292.17 - rule eq-any {C : context}: - `%|-%<:%`(C, EQ_heaptype, ANY_heaptype) + ;; 6-typing.watsup:335.1-337.41 + rule nofunc {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NOFUNC_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, FUNC_heaptype) - ;; 6-typing.watsup:294.1-295.17 - rule i31-eq {C : context}: - `%|-%<:%`(C, I31_heaptype, EQ_heaptype) + ;; 6-typing.watsup:331.1-333.40 + rule none {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NONE_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, ANY_heaptype) - ;; 6-typing.watsup:297.1-298.20 - rule struct-eq {C : context}: - `%|-%<:%`(C, STRUCT_heaptype, EQ_heaptype) + ;; 6-typing.watsup:327.1-329.48 + rule rec {C : context, ct : comptype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*, i : nat}: + `%|-%<:%`(C, REC_heaptype(i), ht) + -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) - ;; 6-typing.watsup:300.1-301.19 - rule array-eq {C : context}: - `%|-%<:%`(C, ARRAY_heaptype, EQ_heaptype) + ;; 6-typing.watsup:323.1-325.52 + rule typeidx-r {C : context, heaptype : heaptype, typeidx : typeidx}: + `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, $heaptype_deftype(C.TYPE_context[typeidx])) - ;; 6-typing.watsup:303.1-305.35 - rule struct {C : context, deftype : deftype, yt* : fieldtype*}: - `%|-%<:%`(C, $heaptype_deftype(deftype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) + ;; 6-typing.watsup:319.1-321.52 + rule typeidx-l {C : context, heaptype : heaptype, typeidx : typeidx}: + `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) + -- Heaptype_sub: `%|-%<:%`(C, $heaptype_deftype(C.TYPE_context[typeidx]), heaptype) - ;; 6-typing.watsup:307.1-309.33 - rule array {C : context, deftype : deftype, yt : fieldtype}: - `%|-%<:%`(C, $heaptype_deftype(deftype), ARRAY_heaptype) - -- Expand: `%~~%`(deftype, ARRAY_comptype(yt)) + ;; 6-typing.watsup:315.1-317.46 + rule def {C : context, deftype_1 : deftype, deftype_2 : deftype}: + `%|-%<:%`(C, $heaptype_deftype(deftype_1), $heaptype_deftype(deftype_2)) + -- Deftype_sub: `%|-%<:%`(C, deftype_1, deftype_2) ;; 6-typing.watsup:311.1-313.32 rule func {C : context, deftype : deftype, ft : functype}: `%|-%<:%`(C, $heaptype_deftype(deftype), FUNC_heaptype) -- Expand: `%~~%`(deftype, FUNC_comptype(ft)) - ;; 6-typing.watsup:315.1-317.46 - rule def {C : context, deftype_1 : deftype, deftype_2 : deftype}: - `%|-%<:%`(C, $heaptype_deftype(deftype_1), $heaptype_deftype(deftype_2)) - -- Deftype_sub: `%|-%<:%`(C, deftype_1, deftype_2) + ;; 6-typing.watsup:307.1-309.33 + rule array {C : context, deftype : deftype, yt : fieldtype}: + `%|-%<:%`(C, $heaptype_deftype(deftype), ARRAY_heaptype) + -- Expand: `%~~%`(deftype, ARRAY_comptype(yt)) - ;; 6-typing.watsup:319.1-321.52 - rule typeidx-l {C : context, heaptype : heaptype, typeidx : typeidx}: - `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) - -- Heaptype_sub: `%|-%<:%`(C, $heaptype_deftype(C.TYPE_context[typeidx]), heaptype) + ;; 6-typing.watsup:303.1-305.35 + rule struct {C : context, deftype : deftype, yt* : fieldtype*}: + `%|-%<:%`(C, $heaptype_deftype(deftype), STRUCT_heaptype) + -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) - ;; 6-typing.watsup:323.1-325.52 - rule typeidx-r {C : context, heaptype : heaptype, typeidx : typeidx}: - `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, $heaptype_deftype(C.TYPE_context[typeidx])) + ;; 6-typing.watsup:300.1-301.19 + rule array-eq {C : context}: + `%|-%<:%`(C, ARRAY_heaptype, EQ_heaptype) - ;; 6-typing.watsup:327.1-329.48 - rule rec {C : context, ct : comptype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*, i : nat}: - `%|-%<:%`(C, REC_heaptype(i), ht) - -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + ;; 6-typing.watsup:297.1-298.20 + rule struct-eq {C : context}: + `%|-%<:%`(C, STRUCT_heaptype, EQ_heaptype) - ;; 6-typing.watsup:331.1-333.40 - rule none {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NONE_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, ANY_heaptype) + ;; 6-typing.watsup:294.1-295.17 + rule i31-eq {C : context}: + `%|-%<:%`(C, I31_heaptype, EQ_heaptype) - ;; 6-typing.watsup:335.1-337.41 - rule nofunc {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NOFUNC_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, FUNC_heaptype) + ;; 6-typing.watsup:291.1-292.17 + rule eq-any {C : context}: + `%|-%<:%`(C, EQ_heaptype, ANY_heaptype) - ;; 6-typing.watsup:339.1-341.43 - rule noextern {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NOEXTERN_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, EXTERN_heaptype) + ;; 6-typing.watsup:285.1-289.48 + rule trans {C : context, heaptype' : heaptype, heaptype_1 : heaptype, heaptype_2 : heaptype}: + `%|-%<:%`(C, heaptype_1, heaptype_2) + -- Heaptype_ok: `%|-%:OK`(C, heaptype') + -- Heaptype_sub: `%|-%<:%`(C, heaptype_1, heaptype') + -- Heaptype_sub: `%|-%<:%`(C, heaptype', heaptype_2) - ;; 6-typing.watsup:343.1-344.23 - rule bot {C : context, heaptype : heaptype}: - `%|-%<:%`(C, BOT_heaptype, heaptype) + ;; 6-typing.watsup:282.1-283.28 + rule refl {C : context, heaptype : heaptype}: + `%|-%<:%`(C, heaptype, heaptype) } ;; 6-typing.watsup:272.1-272.78 relation Reftype_sub: `%|-%<:%`(context, reftype, reftype) - ;; 6-typing.watsup:347.1-349.37 - rule nonnull {C : context, ht_1 : heaptype, ht_2 : heaptype}: - `%|-%<:%`(C, REF_reftype(`NULL%?`(?()), ht_1), REF_reftype(`NULL%?`(?()), ht_2)) - -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) - ;; 6-typing.watsup:351.1-353.37 rule null {C : context, ht_1 : heaptype, ht_2 : heaptype}: `%|-%<:%`(C, REF_reftype(`NULL%?`(()?{}), ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) + ;; 6-typing.watsup:347.1-349.37 + rule nonnull {C : context, ht_1 : heaptype, ht_2 : heaptype}: + `%|-%<:%`(C, REF_reftype(`NULL%?`(?()), ht_1), REF_reftype(`NULL%?`(?()), ht_2)) + -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) + ;; 6-typing.watsup:270.1-270.78 relation Vectype_sub: `%|-%<:%`(context, vectype, vectype) ;; 6-typing.watsup:278.1-279.26 @@ -10160,50 +10303,50 @@ relation Vectype_sub: `%|-%<:%`(context, vectype, vectype) ;; 6-typing.watsup:273.1-273.78 relation Valtype_sub: `%|-%<:%`(context, valtype, valtype) - ;; 6-typing.watsup:356.1-358.46 - rule num {C : context, numtype_1 : numtype, numtype_2 : numtype}: - `%|-%<:%`(C, $valtype_numtype(numtype_1), $valtype_numtype(numtype_2)) - -- Numtype_sub: `%|-%<:%`(C, numtype_1, numtype_2) - - ;; 6-typing.watsup:360.1-362.46 - rule vec {C : context, vectype_1 : vectype, vectype_2 : vectype}: - `%|-%<:%`(C, $valtype_vectype(vectype_1), $valtype_vectype(vectype_2)) - -- Vectype_sub: `%|-%<:%`(C, vectype_1, vectype_2) + ;; 6-typing.watsup:368.1-369.22 + rule bot {C : context, valtype : valtype}: + `%|-%<:%`(C, BOT_valtype, valtype) ;; 6-typing.watsup:364.1-366.46 rule ref {C : context, reftype_1 : reftype, reftype_2 : reftype}: `%|-%<:%`(C, $valtype_reftype(reftype_1), $valtype_reftype(reftype_2)) -- Reftype_sub: `%|-%<:%`(C, reftype_1, reftype_2) - ;; 6-typing.watsup:368.1-369.22 - rule bot {C : context, valtype : valtype}: - `%|-%<:%`(C, BOT_valtype, valtype) + ;; 6-typing.watsup:360.1-362.46 + rule vec {C : context, vectype_1 : vectype, vectype_2 : vectype}: + `%|-%<:%`(C, $valtype_vectype(vectype_1), $valtype_vectype(vectype_2)) + -- Vectype_sub: `%|-%<:%`(C, vectype_1, vectype_2) + + ;; 6-typing.watsup:356.1-358.46 + rule num {C : context, numtype_1 : numtype, numtype_2 : numtype}: + `%|-%<:%`(C, $valtype_numtype(numtype_1), $valtype_numtype(numtype_2)) + -- Numtype_sub: `%|-%<:%`(C, numtype_1, numtype_2) ;; 6-typing.watsup:392.1-392.92 relation Storagetype_sub: `%|-%<:%`(context, storagetype, storagetype) - ;; 6-typing.watsup:402.1-404.46 - rule val {C : context, valtype_1 : valtype, valtype_2 : valtype}: - `%|-%<:%`(C, $storagetype_valtype(valtype_1), $storagetype_valtype(valtype_2)) - -- Valtype_sub: `%|-%<:%`(C, valtype_1, valtype_2) - ;; 6-typing.watsup:406.1-408.55 rule packed {C : context, packedtype_1 : packedtype, packedtype_2 : packedtype}: `%|-%<:%`(C, $storagetype_packedtype(packedtype_1), $storagetype_packedtype(packedtype_2)) -- Packedtype_sub: `%|-%<:%`(C, packedtype_1, packedtype_2) + ;; 6-typing.watsup:402.1-404.46 + rule val {C : context, valtype_1 : valtype, valtype_2 : valtype}: + `%|-%<:%`(C, $storagetype_valtype(valtype_1), $storagetype_valtype(valtype_2)) + -- Valtype_sub: `%|-%<:%`(C, valtype_1, valtype_2) + ;; 6-typing.watsup:393.1-393.90 relation Fieldtype_sub: `%|-%<:%`(context, fieldtype, fieldtype) - ;; 6-typing.watsup:411.1-413.40 - rule const {C : context, zt_1 : storagetype, zt_2 : storagetype}: - `%|-%<:%`(C, `%%`(`MUT%?`(?()), zt_1), `%%`(`MUT%?`(?()), zt_2)) - -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) - ;; 6-typing.watsup:415.1-418.40 rule var {C : context, zt_1 : storagetype, zt_2 : storagetype}: `%|-%<:%`(C, `%%`(`MUT%?`(?(())), zt_1), `%%`(`MUT%?`(?(())), zt_2)) -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) + ;; 6-typing.watsup:411.1-413.40 + rule const {C : context, zt_1 : storagetype, zt_2 : storagetype}: + `%|-%<:%`(C, `%%`(`MUT%?`(?()), zt_1), `%%`(`MUT%?`(?()), zt_2)) + -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) + ;; 6-typing.watsup:395.1-395.89 relation Functype_sub: `%|-%<:%`(context, functype, functype) ;; 6-typing.watsup:458.1-459.16 @@ -10212,20 +10355,20 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) ;; 6-typing.watsup:124.1-124.76 relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) - ;; 6-typing.watsup:421.1-423.41 - rule struct {C : context, yt'_1 : fieldtype, yt_1* : fieldtype*, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) - -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} + ;; 6-typing.watsup:429.1-431.37 + rule func {C : context, ft_1 : functype, ft_2 : functype}: + `%|-%<:%`(C, FUNC_comptype(ft_1), FUNC_comptype(ft_2)) + -- Functype_sub: `%|-%<:%`(C, ft_1, ft_2) ;; 6-typing.watsup:425.1-427.38 rule array {C : context, yt_1 : fieldtype, yt_2 : fieldtype}: `%|-%<:%`(C, ARRAY_comptype(yt_1), ARRAY_comptype(yt_2)) -- Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2) - ;; 6-typing.watsup:429.1-431.37 - rule func {C : context, ft_1 : functype, ft_2 : functype}: - `%|-%<:%`(C, FUNC_comptype(ft_1), FUNC_comptype(ft_2)) - -- Functype_sub: `%|-%<:%`(C, ft_1, ft_2) + ;; 6-typing.watsup:421.1-423.41 + rule struct {C : context, yt'_1 : fieldtype, yt_1* : fieldtype*, yt_2* : fieldtype*}: + `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) + -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} ;; 6-typing.watsup:117.1-117.73 relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) @@ -10240,21 +10383,21 @@ relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) ;; 6-typing.watsup:165.1-165.65 def before : (heaptype, typeidx, nat) -> bool - ;; 6-typing.watsup:166.1-166.34 - def {deftype : deftype, i : nat, x : idx} before($heaptype_deftype(deftype), x, i) = true - ;; 6-typing.watsup:167.1-167.46 - def {i : nat, typeidx : typeidx, x : idx} before(_IDX_heaptype(typeidx), x, i) = (typeidx < x) ;; 6-typing.watsup:168.1-168.33 def {i : nat, j : nat, x : idx} before(REC_heaptype(j), x, i) = (j < i) + ;; 6-typing.watsup:167.1-167.46 + def {i : nat, typeidx : typeidx, x : idx} before(_IDX_heaptype(typeidx), x, i) = (typeidx < x) + ;; 6-typing.watsup:166.1-166.34 + def {deftype : deftype, i : nat, x : idx} before($heaptype_deftype(deftype), x, i) = true ;; 6-typing.watsup:170.1-170.69 def unrollht : (context, heaptype) -> subtype - ;; 6-typing.watsup:171.1-171.47 - def {C : context, deftype : deftype} unrollht(C, $heaptype_deftype(deftype)) = $unrolldt(deftype) - ;; 6-typing.watsup:172.1-172.60 - def {C : context, typeidx : typeidx} unrollht(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx]) ;; 6-typing.watsup:173.1-173.35 def {C : context, i : nat} unrollht(C, REC_heaptype(i)) = C.REC_context[i] + ;; 6-typing.watsup:172.1-172.60 + def {C : context, typeidx : typeidx} unrollht(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx]) + ;; 6-typing.watsup:171.1-171.47 + def {C : context, deftype : deftype} unrollht(C, $heaptype_deftype(deftype)) = $unrolldt(deftype) ;; 6-typing.watsup:119.1-119.76 relation Subtype_ok2: `%|-%:%`(context, subtype, oktypeidxnat) @@ -10272,15 +10415,15 @@ rec { ;; 6-typing.watsup:120.1-120.76 relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) - ;; 6-typing.watsup:196.1-197.24 - rule empty {C : context, i : nat, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) - ;; 6-typing.watsup:199.1-202.50 rule cons {C : context, i : nat, st* : subtype*, st_1 : subtype, x : idx}: `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidxnat((x + 1), (i + 1))) + + ;; 6-typing.watsup:196.1-197.24 + rule empty {C : context, i : nat, x : idx}: + `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) } ;; 6-typing.watsup:118.1-118.74 @@ -10288,9 +10431,10 @@ rec { ;; 6-typing.watsup:118.1-118.74 relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) - ;; 6-typing.watsup:184.1-185.23 - rule empty {C : context, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) + ;; 6-typing.watsup:192.1-194.49 + rule rec2 {C : context, st* : subtype*, x : idx}: + `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) ;; 6-typing.watsup:187.1-190.43 rule cons {C : context, st* : subtype*, st_1 : subtype, x : idx}: @@ -10298,10 +10442,9 @@ relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x + 1)) - ;; 6-typing.watsup:192.1-194.49 - rule rec2 {C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) + ;; 6-typing.watsup:184.1-185.23 + rule empty {C : context, x : idx}: + `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) } ;; 6-typing.watsup:121.1-121.73 @@ -10344,26 +10487,26 @@ relation Memtype_ok: `%|-%:OK`(context, memtype) ;; 6-typing.watsup:218.1-218.74 relation Externtype_ok: `%|-%:OK`(context, externtype) - ;; 6-typing.watsup:244.1-247.27 - rule func {C : context, dt : deftype, ft : functype}: - `%|-%:OK`(C, FUNC_externtype(dt)) - -- Deftype_ok: `%|-%:OK`(C, dt) - -- Expand: `%~~%`(dt, FUNC_comptype(ft)) - - ;; 6-typing.watsup:249.1-251.33 - rule global {C : context, gt : globaltype}: - `%|-%:OK`(C, GLOBAL_externtype(gt)) - -- Globaltype_ok: `%|-%:OK`(C, gt) + ;; 6-typing.watsup:257.1-259.30 + rule mem {C : context, mt : memtype}: + `%|-%:OK`(C, MEM_externtype(mt)) + -- Memtype_ok: `%|-%:OK`(C, mt) ;; 6-typing.watsup:253.1-255.32 rule table {C : context, tt : tabletype}: `%|-%:OK`(C, TABLE_externtype(tt)) -- Tabletype_ok: `%|-%:OK`(C, tt) - ;; 6-typing.watsup:257.1-259.30 - rule mem {C : context, mt : memtype}: - `%|-%:OK`(C, MEM_externtype(mt)) - -- Memtype_ok: `%|-%:OK`(C, mt) + ;; 6-typing.watsup:249.1-251.33 + rule global {C : context, gt : globaltype}: + `%|-%:OK`(C, GLOBAL_externtype(gt)) + -- Globaltype_ok: `%|-%:OK`(C, gt) + + ;; 6-typing.watsup:244.1-247.27 + rule func {C : context, dt : deftype, ft : functype}: + `%|-%:OK`(C, FUNC_externtype(dt)) + -- Deftype_ok: `%|-%:OK`(C, dt) + -- Expand: `%~~%`(dt, FUNC_comptype(ft)) ;; 6-typing.watsup:374.1-374.81 relation Resulttype_sub: `%|-%*<:%*`(context, valtype*, valtype*) @@ -10392,17 +10535,17 @@ relation Limits_sub: `%|-%<:%`(context, limits, limits) ;; 6-typing.watsup:447.1-447.83 relation Globaltype_sub: `%|-%<:%`(context, globaltype, globaltype) - ;; 6-typing.watsup:461.1-463.34 - rule const {C : context, t_1 : valtype, t_2 : valtype}: - `%|-%<:%`(C, `%%`(`MUT%?`(?()), t_1), `%%`(`MUT%?`(?()), t_2)) - -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) - ;; 6-typing.watsup:465.1-468.34 rule var {C : context, t_1 : valtype, t_2 : valtype}: `%|-%<:%`(C, `%%`(`MUT%?`(?(())), t_1), `%%`(`MUT%?`(?(())), t_2)) -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) -- Valtype_sub: `%|-%<:%`(C, t_2, t_1) + ;; 6-typing.watsup:461.1-463.34 + rule const {C : context, t_1 : valtype, t_2 : valtype}: + `%|-%<:%`(C, `%%`(`MUT%?`(?()), t_1), `%%`(`MUT%?`(?()), t_2)) + -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) + ;; 6-typing.watsup:448.1-448.82 relation Tabletype_sub: `%|-%<:%`(context, tabletype, tabletype) ;; 6-typing.watsup:470.1-474.36 @@ -10421,269 +10564,243 @@ relation Memtype_sub: `%|-%<:%`(context, memtype, memtype) ;; 6-typing.watsup:450.1-450.83 relation Externtype_sub: `%|-%<:%`(context, externtype, externtype) - ;; 6-typing.watsup:481.1-483.36 - rule func {C : context, dt_1 : deftype, dt_2 : deftype}: - `%|-%<:%`(C, FUNC_externtype(dt_1), FUNC_externtype(dt_2)) - -- Deftype_sub: `%|-%<:%`(C, dt_1, dt_2) - - ;; 6-typing.watsup:485.1-487.39 - rule global {C : context, gt_1 : globaltype, gt_2 : globaltype}: - `%|-%<:%`(C, GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) - -- Globaltype_sub: `%|-%<:%`(C, gt_1, gt_2) + ;; 6-typing.watsup:493.1-495.36 + rule mem {C : context, mt_1 : memtype, mt_2 : memtype}: + `%|-%<:%`(C, MEM_externtype(mt_1), MEM_externtype(mt_2)) + -- Memtype_sub: `%|-%<:%`(C, mt_1, mt_2) ;; 6-typing.watsup:489.1-491.38 rule table {C : context, tt_1 : tabletype, tt_2 : tabletype}: `%|-%<:%`(C, TABLE_externtype(tt_1), TABLE_externtype(tt_2)) -- Tabletype_sub: `%|-%<:%`(C, tt_1, tt_2) - ;; 6-typing.watsup:493.1-495.36 - rule mem {C : context, mt_1 : memtype, mt_2 : memtype}: - `%|-%<:%`(C, MEM_externtype(mt_1), MEM_externtype(mt_2)) - -- Memtype_sub: `%|-%<:%`(C, mt_1, mt_2) + ;; 6-typing.watsup:485.1-487.39 + rule global {C : context, gt_1 : globaltype, gt_2 : globaltype}: + `%|-%<:%`(C, GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) + -- Globaltype_sub: `%|-%<:%`(C, gt_1, gt_2) + + ;; 6-typing.watsup:481.1-483.36 + rule func {C : context, dt_1 : deftype, dt_2 : deftype}: + `%|-%<:%`(C, FUNC_externtype(dt_1), FUNC_externtype(dt_2)) + -- Deftype_sub: `%|-%<:%`(C, dt_1, dt_2) ;; 6-typing.watsup:565.1-565.76 relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) - ;; 6-typing.watsup:567.1-568.32 - rule void {C : context}: - `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) + ;; 6-typing.watsup:573.1-575.34 + rule typeidx {C : context, ft : functype, x : idx}: + `%|-%:%`(C, _IDX_blocktype(x), ft) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(ft)) ;; 6-typing.watsup:570.1-571.28 rule result {C : context, t : valtype}: `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`([], [t])) - ;; 6-typing.watsup:573.1-575.34 - rule typeidx {C : context, ft : functype, x : idx}: - `%|-%:%`(C, _IDX_blocktype(x), ft) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(ft)) + ;; 6-typing.watsup:567.1-568.32 + rule void {C : context}: + `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) ;; 6-typing.watsup:503.1-505.74 rec { ;; 6-typing.watsup:503.1-503.67 relation Instr_ok: `%|-%:%`(context, instr, functype) - ;; 6-typing.watsup:544.1-545.34 - rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) - - ;; 6-typing.watsup:547.1-548.24 - rule nop {C : context}: - `%|-%:%`(C, NOP_instr, `%->%`([], [])) - - ;; 6-typing.watsup:550.1-551.23 - rule drop {C : context, t : valtype}: - `%|-%:%`(C, DROP_instr, `%->%`([t], [])) - - ;; 6-typing.watsup:554.1-555.31 - rule select-expl {C : context, t : valtype}: - `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) - - ;; 6-typing.watsup:557.1-560.37 - rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: - `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) - -- Valtype_sub: `%|-%<:%`(C, t, t') - -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) + ;; 6-typing.watsup:951.1-956.29 + rule store {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, x : idx}: + `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype $valtype_numtype(nt)], [])) + -- if (C.MEM_context[x] = mt) + -- if ((2 ^ n_A) <= (!($size($valtype_numtype(nt))) / 8)) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (!($size($valtype_numtype(nt))) / 8))))?{n} + -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) - ;; 6-typing.watsup:578.1-581.61 - rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:944.1-949.29 + rule load {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, x : idx}: + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [$valtype_numtype(nt)])) + -- if (C.MEM_context[x] = mt) + -- if ((2 ^ n_A) <= (!($size($valtype_numtype(nt))) / 8)) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (!($size($valtype_numtype(nt))) / 8))))?{n} + -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) - ;; 6-typing.watsup:583.1-586.61 - rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:940.1-942.23 + rule data.drop {C : context, x : idx}: + `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) + -- if (C.DATA_context[x] = OK) - ;; 6-typing.watsup:588.1-592.65 - rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: - `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) + ;; 6-typing.watsup:935.1-938.23 + rule memory.init {C : context, mt : memtype, x : idx, y : idx}: + `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x] = mt) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:597.1-599.24 - rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.LABEL_context[l] = t*{t}) + ;; 6-typing.watsup:930.1-933.26 + rule memory.copy {C : context, mt_1 : memtype, mt_2 : memtype, x_1 : idx, x_2 : idx}: + `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x_1] = mt_1) + -- if (C.MEM_context[x_2] = mt_2) - ;; 6-typing.watsup:601.1-603.24 - rule br_if {C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) - -- if (C.LABEL_context[l] = t*{t}) + ;; 6-typing.watsup:926.1-928.22 + rule memory.fill {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:605.1-608.44 - rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- (Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l]))*{l} - -- Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l']) + ;; 6-typing.watsup:922.1-924.22 + rule memory.grow {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:610.1-613.31 - rule br_on_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[l] = t*{t}) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:918.1-920.22 + rule memory.size {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:615.1-618.31 - rule br_on_non_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) - -- if (C.LABEL_context[l] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:911.1-913.23 + rule elem.drop {C : context, rt : reftype, x : idx}: + `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) + -- if (C.ELEM_context[x] = rt) - ;; 6-typing.watsup:620.1-626.34 - rule br_on_cast {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype($diffrt(rt_1, rt_2))])) - -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) - -- Reftype_ok: `%|-%:OK`(C, rt_1) - -- Reftype_ok: `%|-%:OK`(C, rt_2) + ;; 6-typing.watsup:905.1-909.36 + rule table.init {C : context, lim : limits, rt_1 : reftype, rt_2 : reftype, x : idx, y : idx}: + `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.TABLE_context[x] = `%%`(lim, rt_1)) + -- if (C.ELEM_context[y] = rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) - ;; 6-typing.watsup:628.1-634.49 - rule br_on_cast_fail {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype(rt_2)])) - -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) - -- Reftype_ok: `%|-%:OK`(C, rt_1) - -- Reftype_ok: `%|-%:OK`(C, rt_2) + ;; 6-typing.watsup:899.1-903.36 + rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt_1 : reftype, rt_2 : reftype, x_1 : idx, x_2 : idx}: + `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt_1)) + -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt_2)) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) - ;; 6-typing.watsup:639.1-641.24 - rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.RETURN_context = ?(t*{t})) + ;; 6-typing.watsup:895.1-897.28 + rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:643.1-645.46 - rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + ;; 6-typing.watsup:891.1-893.28 + rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:647.1-649.46 - rule call_ref {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_2*{t_2})) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + ;; 6-typing.watsup:887.1-889.24 + rule table.size {C : context, tt : tabletype, x : idx}: + `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) + -- if (C.TABLE_context[x] = tt) - ;; 6-typing.watsup:651.1-655.46 - rule call_indirect {C : context, lim : limits, rt : reftype, t_1* : valtype*, t_2* : valtype*, x : idx, y : idx}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + ;; 6-typing.watsup:883.1-885.28 + rule table.set {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:657.1-661.40 - rule return_call {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) - -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - - ;; 6-typing.watsup:663.1-667.40 - rule return_call_ref {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_4*{t_4})) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - - ;; 6-typing.watsup:669.1-675.40 - rule return_call_indirect {C : context, lim : limits, rt : reftype, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx, y : idx}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) + ;; 6-typing.watsup:879.1-881.28 + rule table.get {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:680.1-681.33 - rule const {C : context, c_nt : c, nt : numtype}: - `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) + ;; 6-typing.watsup:872.1-874.28 + rule global.set {C : context, t : valtype, x : idx}: + `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) + -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?(())), t)) - ;; 6-typing.watsup:683.1-684.31 - rule unop {C : context, nt : numtype, unop : unop_numtype}: - `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) + ;; 6-typing.watsup:868.1-870.28 + rule global.get {C : context, mut : mut, t : valtype, x : idx}: + `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) + -- if (C.GLOBAL_context[x] = `%%`(mut, t)) - ;; 6-typing.watsup:686.1-687.36 - rule binop {C : context, binop : binop_numtype, nt : numtype}: - `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) + ;; 6-typing.watsup:853.1-855.28 + rule local.get {C : context, init : init, t : valtype, x : idx}: + `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) + -- if (C.LOCAL_context[x] = `%%`(init, t)) - ;; 6-typing.watsup:689.1-690.36 - rule testop {C : context, nt : numtype, testop : testop_numtype}: - `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) + ;; 6-typing.watsup:847.1-848.62 + rule any.convert_extern {C : context, nul : nul}: + `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) - ;; 6-typing.watsup:692.1-693.37 - rule relop {C : context, nt : numtype, relop : relop_numtype}: - `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) + ;; 6-typing.watsup:844.1-845.62 + rule extern.convert_any {C : context, nul : nul}: + `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) - ;; 6-typing.watsup:696.1-698.23 - rule extend {C : context, n : n, nt : numtype}: - `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - -- if (n <= !($size($valtype_numtype(nt)))) + ;; 6-typing.watsup:835.1-839.23 + rule array.init_data {C : context, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:700.1-703.34 - rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) - -- if (nt_1 =/= nt_2) - -- if (!($size($valtype_numtype(nt_1))) = !($size($valtype_numtype(nt_2)))) + ;; 6-typing.watsup:830.1-833.43 + rule array.init_elem {C : context, x : idx, y : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- Storagetype_sub: `%|-%<:%`(C, $storagetype_elemtype(C.ELEM_context[y]), zt) - ;; 6-typing.watsup:705.1-708.50 - rule convert-i {C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: - `%|-%:%`(C, CVTOP_instr($numtype_inn(inn_1), CONVERT_cvtop, $numtype_inn(inn_2), sx?{sx}), `%->%`([$valtype_inn(inn_2)], [$valtype_inn(inn_1)])) - -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> (!($size($valtype_inn(inn_1))) > !($size($valtype_inn(inn_2))))) + ;; 6-typing.watsup:824.1-828.40 + rule array.copy {C : context, mut : mut, x_1 : idx, x_2 : idx, zt_1 : storagetype, zt_2 : storagetype}: + `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_1))) I32_valtype REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_2))) I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x_1], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) + -- Expand: `%~~%`(C.TYPE_context[x_2], ARRAY_comptype(`%%`(mut, zt_2))) + -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) - ;; 6-typing.watsup:710.1-712.24 - rule convert-f {C : context, fnn_1 : fnn, fnn_2 : fnn}: - `%|-%:%`(C, CVTOP_instr($numtype_fnn(fnn_1), CONVERT_cvtop, $numtype_fnn(fnn_2), ?()), `%->%`([$valtype_fnn(fnn_2)], [$valtype_fnn(fnn_1)])) - -- if (fnn_1 =/= fnn_2) + ;; 6-typing.watsup:820.1-822.41 + rule array.fill {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt) I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:717.1-719.31 - rule ref.null {C : context, ht : heaptype}: - `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:816.1-818.41 + rule array.len {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:722.1-724.23 - rule ref.func {C : context, dt : deftype, epsilon : resulttype, x : idx}: - `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), $heaptype_deftype(dt))])) - -- if (C.FUNC_context[x] = dt) + ;; 6-typing.watsup:812.1-814.41 + rule array.set {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt)], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:726.1-727.34 - rule ref.i31 {C : context}: - `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) + ;; 6-typing.watsup:807.1-810.43 + rule array.get {C : context, mut : mut, sx? : sx?, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype], [$unpacktype(zt)])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) - ;; 6-typing.watsup:729.1-730.31 - rule ref.is_null {C : context, rt : reftype}: - `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) + ;; 6-typing.watsup:801.1-805.23 + rule array.new_data {C : context, mut : mut, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx}: + `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_valtype(t)))) + -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:732.1-734.31 - rule ref.as_non_null {C : context, ht : heaptype}: - `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:796.1-799.39 + rule array.new_elem {C : context, mut : mut, rt : reftype, x : idx, y : idx}: + `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_reftype(rt)))) + -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y], rt) - ;; 6-typing.watsup:736.1-737.51 - rule ref.eq {C : context}: - `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) + ;; 6-typing.watsup:792.1-794.41 + rule array.new_fixed {C : context, mut : mut, n : n, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpacktype(zt)], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - ;; 6-typing.watsup:739.1-743.33 - rule ref.test {C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([$valtype_reftype(rt')], [I32_valtype])) - -- Reftype_ok: `%|-%:OK`(C, rt) - -- Reftype_ok: `%|-%:OK`(C, rt') - -- Reftype_sub: `%|-%<:%`(C, rt, rt') + ;; 6-typing.watsup:787.1-790.40 + rule array.new_default {C : context, mut : mut, val : val, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- if ($default($unpacktype(zt)) = ?(val)) - ;; 6-typing.watsup:745.1-749.33 - rule ref.cast {C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([$valtype_reftype(rt')], [$valtype_reftype(rt)])) - -- Reftype_ok: `%|-%:OK`(C, rt) - -- Reftype_ok: `%|-%:OK`(C, rt') - -- Reftype_sub: `%|-%<:%`(C, rt, rt') + ;; 6-typing.watsup:783.1-785.41 + rule array.new {C : context, mut : mut, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpacktype(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - ;; 6-typing.watsup:754.1-755.42 - rule i31.get {C : context, sx : sx}: - `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) + ;; 6-typing.watsup:775.1-778.24 + rule struct.set {C : context, i : nat, x : idx, yt* : fieldtype*, zt : storagetype}: + `%|-%:%`(C, STRUCT.SET_instr(x, i), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) $unpacktype(zt)], [])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) + -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) - ;; 6-typing.watsup:760.1-762.43 - rule struct.new {C : context, mut* : mut*, x : idx, zt* : storagetype*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + ;; 6-typing.watsup:769.1-773.43 + rule struct.get {C : context, i : nat, mut : mut, sx? : sx?, x : idx, yt* : fieldtype*, zt : storagetype}: + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx}, x, i), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], [$unpacktype(zt)])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) + -- if (yt*{yt}[i] = `%%`(mut, zt)) + -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) ;; 6-typing.watsup:764.1-767.43 rule struct.new_default {C : context, mut* : mut*, val* : val*, x : idx, zt* : storagetype*}: @@ -10691,226 +10808,259 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} - ;; 6-typing.watsup:769.1-773.43 - rule struct.get {C : context, i : nat, mut : mut, sx? : sx?, x : idx, yt* : fieldtype*, zt : storagetype}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx}, x, i), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], [$unpacktype(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(mut, zt)) - -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) + ;; 6-typing.watsup:760.1-762.43 + rule struct.new {C : context, mut* : mut*, x : idx, zt* : storagetype*}: + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - ;; 6-typing.watsup:775.1-778.24 - rule struct.set {C : context, i : nat, x : idx, yt* : fieldtype*, zt : storagetype}: - `%|-%:%`(C, STRUCT.SET_instr(x, i), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) $unpacktype(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) + ;; 6-typing.watsup:754.1-755.42 + rule i31.get {C : context, sx : sx}: + `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) - ;; 6-typing.watsup:783.1-785.41 - rule array.new {C : context, mut : mut, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpacktype(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + ;; 6-typing.watsup:745.1-749.33 + rule ref.cast {C : context, rt : reftype, rt' : reftype}: + `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([$valtype_reftype(rt')], [$valtype_reftype(rt)])) + -- Reftype_ok: `%|-%:OK`(C, rt) + -- Reftype_ok: `%|-%:OK`(C, rt') + -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:787.1-790.40 - rule array.new_default {C : context, mut : mut, val : val, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - -- if ($default($unpacktype(zt)) = ?(val)) + ;; 6-typing.watsup:739.1-743.33 + rule ref.test {C : context, rt : reftype, rt' : reftype}: + `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([$valtype_reftype(rt')], [I32_valtype])) + -- Reftype_ok: `%|-%:OK`(C, rt) + -- Reftype_ok: `%|-%:OK`(C, rt') + -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:792.1-794.41 - rule array.new_fixed {C : context, mut : mut, n : n, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpacktype(zt)], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + ;; 6-typing.watsup:736.1-737.51 + rule ref.eq {C : context}: + `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) - ;; 6-typing.watsup:796.1-799.39 - rule array.new_elem {C : context, mut : mut, rt : reftype, x : idx, y : idx}: - `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_reftype(rt)))) - -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y], rt) + ;; 6-typing.watsup:732.1-734.31 + rule ref.as_non_null {C : context, ht : heaptype}: + `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:801.1-805.23 - rule array.new_data {C : context, mut : mut, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx}: - `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_valtype(t)))) - -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:729.1-730.31 + rule ref.is_null {C : context, rt : reftype}: + `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) - ;; 6-typing.watsup:807.1-810.43 - rule array.get {C : context, mut : mut, sx? : sx?, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype], [$unpacktype(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) + ;; 6-typing.watsup:726.1-727.34 + rule ref.i31 {C : context}: + `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) - ;; 6-typing.watsup:812.1-814.41 - rule array.set {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:722.1-724.23 + rule ref.func {C : context, dt : deftype, epsilon : resulttype, x : idx}: + `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), $heaptype_deftype(dt))])) + -- if (C.FUNC_context[x] = dt) - ;; 6-typing.watsup:816.1-818.41 - rule array.len {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:717.1-719.31 + rule ref.null {C : context, ht : heaptype}: + `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:820.1-822.41 - rule array.fill {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt) I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:710.1-712.24 + rule convert-f {C : context, fnn_1 : fnn, fnn_2 : fnn}: + `%|-%:%`(C, CVTOP_instr($numtype_fnn(fnn_1), CONVERT_cvtop, $numtype_fnn(fnn_2), ?()), `%->%`([$valtype_fnn(fnn_2)], [$valtype_fnn(fnn_1)])) + -- if (fnn_1 =/= fnn_2) - ;; 6-typing.watsup:824.1-828.40 - rule array.copy {C : context, mut : mut, x_1 : idx, x_2 : idx, zt_1 : storagetype, zt_2 : storagetype}: - `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_1))) I32_valtype REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_2))) I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x_1], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) - -- Expand: `%~~%`(C.TYPE_context[x_2], ARRAY_comptype(`%%`(mut, zt_2))) - -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) + ;; 6-typing.watsup:705.1-708.50 + rule convert-i {C : context, inn_1 : inn, inn_2 : inn, sx? : sx?}: + `%|-%:%`(C, CVTOP_instr($numtype_inn(inn_1), CONVERT_cvtop, $numtype_inn(inn_2), sx?{sx}), `%->%`([$valtype_inn(inn_2)], [$valtype_inn(inn_1)])) + -- if (inn_1 =/= inn_2) + -- if ((sx?{sx} = ?()) <=> (!($size($valtype_inn(inn_1))) > !($size($valtype_inn(inn_2))))) - ;; 6-typing.watsup:830.1-833.43 - rule array.init_elem {C : context, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- Storagetype_sub: `%|-%<:%`(C, $storagetype_elemtype(C.ELEM_context[y]), zt) + ;; 6-typing.watsup:700.1-703.34 + rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype}: + `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) + -- if (nt_1 =/= nt_2) + -- if (!($size($valtype_numtype(nt_1))) = !($size($valtype_numtype(nt_2)))) - ;; 6-typing.watsup:835.1-839.23 - rule array.init_data {C : context, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:696.1-698.23 + rule extend {C : context, n : n, nt : numtype}: + `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) + -- if (n <= !($size($valtype_numtype(nt)))) - ;; 6-typing.watsup:844.1-845.62 - rule extern.convert_any {C : context, nul : nul}: - `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) + ;; 6-typing.watsup:692.1-693.37 + rule relop {C : context, nt : numtype, relop : relop_numtype}: + `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) - ;; 6-typing.watsup:847.1-848.62 - rule any.convert_extern {C : context, nul : nul}: - `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) + ;; 6-typing.watsup:689.1-690.36 + rule testop {C : context, nt : numtype, testop : testop_numtype}: + `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) - ;; 6-typing.watsup:853.1-855.28 - rule local.get {C : context, init : init, t : valtype, x : idx}: - `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) - -- if (C.LOCAL_context[x] = `%%`(init, t)) + ;; 6-typing.watsup:686.1-687.36 + rule binop {C : context, binop : binop_numtype, nt : numtype}: + `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:868.1-870.28 - rule global.get {C : context, mut : mut, t : valtype, x : idx}: - `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) - -- if (C.GLOBAL_context[x] = `%%`(mut, t)) + ;; 6-typing.watsup:683.1-684.31 + rule unop {C : context, nt : numtype, unop : unop_numtype}: + `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:872.1-874.28 - rule global.set {C : context, t : valtype, x : idx}: - `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) - -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?(())), t)) + ;; 6-typing.watsup:680.1-681.33 + rule const {C : context, c_nt : c, nt : numtype}: + `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:879.1-881.28 - rule table.get {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) + ;; 6-typing.watsup:669.1-675.40 + rule return_call_indirect {C : context, lim : limits, rt : reftype, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx, y : idx}: + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) + -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:883.1-885.28 - rule table.set {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:663.1-667.40 + rule return_call_ref {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_4*{t_4})) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:887.1-889.24 - rule table.size {C : context, tt : tabletype, x : idx}: - `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) - -- if (C.TABLE_context[x] = tt) + ;; 6-typing.watsup:657.1-661.40 + rule return_call {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) + -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:891.1-893.28 - rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) + ;; 6-typing.watsup:651.1-655.46 + rule call_indirect {C : context, lim : limits, rt : reftype, t_1* : valtype*, t_2* : valtype*, x : idx, y : idx}: + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) + -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:895.1-897.28 - rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:647.1-649.46 + rule call_ref {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_2*{t_2})) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:899.1-903.36 - rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt_1 : reftype, rt_2 : reftype, x_1 : idx, x_2 : idx}: - `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt_1)) - -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt_2)) + ;; 6-typing.watsup:643.1-645.46 + rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: + `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + + ;; 6-typing.watsup:639.1-641.24 + rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- if (C.RETURN_context = ?(t*{t})) + + ;; 6-typing.watsup:628.1-634.49 + rule br_on_cast_fail {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype(rt_2)])) + -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) + -- Reftype_ok: `%|-%:OK`(C, rt_1) + -- Reftype_ok: `%|-%:OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) - ;; 6-typing.watsup:905.1-909.36 - rule table.init {C : context, lim : limits, rt_1 : reftype, rt_2 : reftype, x : idx, y : idx}: - `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.TABLE_context[x] = `%%`(lim, rt_1)) - -- if (C.ELEM_context[y] = rt_2) + ;; 6-typing.watsup:620.1-626.34 + rule br_on_cast {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype($diffrt(rt_1, rt_2))])) + -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) + -- Reftype_ok: `%|-%:OK`(C, rt_1) + -- Reftype_ok: `%|-%:OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) - ;; 6-typing.watsup:911.1-913.23 - rule elem.drop {C : context, rt : reftype, x : idx}: - `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) - -- if (C.ELEM_context[x] = rt) + ;; 6-typing.watsup:615.1-618.31 + rule br_on_non_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) + -- if (C.LABEL_context[l] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:918.1-920.22 - rule memory.size {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:610.1-613.31 + rule br_on_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) + -- if (C.LABEL_context[l] = t*{t}) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:922.1-924.22 - rule memory.grow {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:605.1-608.44 + rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- (Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l]))*{l} + -- Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l']) - ;; 6-typing.watsup:926.1-928.22 - rule memory.fill {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:601.1-603.24 + rule br_if {C : context, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) + -- if (C.LABEL_context[l] = t*{t}) - ;; 6-typing.watsup:930.1-933.26 - rule memory.copy {C : context, mt_1 : memtype, mt_2 : memtype, x_1 : idx, x_2 : idx}: - `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x_1] = mt_1) - -- if (C.MEM_context[x_2] = mt_2) + ;; 6-typing.watsup:597.1-599.24 + rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- if (C.LABEL_context[l] = t*{t}) - ;; 6-typing.watsup:935.1-938.23 - rule memory.init {C : context, mt : memtype, x : idx, y : idx}: - `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x] = mt) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:588.1-592.65 + rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) - ;; 6-typing.watsup:940.1-942.23 - rule data.drop {C : context, x : idx}: - `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) - -- if (C.DATA_context[x] = OK) + ;; 6-typing.watsup:583.1-586.61 + rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - ;; 6-typing.watsup:944.1-949.29 - rule load {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, x : idx}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [$valtype_numtype(nt)])) - -- if (C.MEM_context[x] = mt) - -- if ((2 ^ n_A) <= (!($size($valtype_numtype(nt))) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (!($size($valtype_numtype(nt))) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) + ;; 6-typing.watsup:578.1-581.61 + rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - ;; 6-typing.watsup:951.1-956.29 - rule store {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, x : idx}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype $valtype_numtype(nt)], [])) - -- if (C.MEM_context[x] = mt) - -- if ((2 ^ n_A) <= (!($size($valtype_numtype(nt))) / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (!($size($valtype_numtype(nt))) / 8))))?{n} - -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) + ;; 6-typing.watsup:557.1-560.37 + rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: + `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) + -- Valtype_sub: `%|-%<:%`(C, t, t') + -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) + + ;; 6-typing.watsup:554.1-555.31 + rule select-expl {C : context, t : valtype}: + `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) + + ;; 6-typing.watsup:550.1-551.23 + rule drop {C : context, t : valtype}: + `%|-%:%`(C, DROP_instr, `%->%`([t], [])) + + ;; 6-typing.watsup:547.1-548.24 + rule nop {C : context}: + `%|-%:%`(C, NOP_instr, `%->%`([], [])) + + ;; 6-typing.watsup:544.1-545.34 + rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) ;; 6-typing.watsup:504.1-504.67 relation Instrf_ok: `%|-%:%`(context, instr, instrtype) - ;; 6-typing.watsup:518.1-520.41 - rule instr {C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + ;; 6-typing.watsup:861.1-863.28 + rule local.tee {C : context, init : init, t : valtype, x : idx}: + `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) + -- if (C.LOCAL_context[x] = `%%`(init, t)) ;; 6-typing.watsup:857.1-859.28 rule local.set {C : context, init : init, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) -- if (C.LOCAL_context[x] = `%%`(init, t)) - ;; 6-typing.watsup:861.1-863.28 - rule local.tee {C : context, init : init, t : valtype, x : idx}: - `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) - -- if (C.LOCAL_context[x] = `%%`(init, t)) + ;; 6-typing.watsup:518.1-520.41 + rule instr {C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) ;; 6-typing.watsup:505.1-505.74 relation Instrs_ok: `%|-%*:%`(context, instr*, instrtype) - ;; 6-typing.watsup:522.1-523.29 - rule empty {C : context}: - `%|-%*:%`(C, [], `%->%*%`([], [], [])) + ;; 6-typing.watsup:537.1-539.47 + rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%*:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + + ;; 6-typing.watsup:532.1-535.35 + rule sub {C : context, instr* : instr*, it : instrtype, it' : instrtype}: + `%|-%*:%`(C, instr*{instr}, it') + -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, it) + -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:525.1-530.52 rule seq {C : context, C' : context, init* : init*, instr_1 : instr, instr_2* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, x_1* : idx*, x_2* : idx*}: @@ -10920,16 +11070,9 @@ relation Instrs_ok: `%|-%*:%`(context, instr*, instrtype) -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) -- Instrs_ok: `%|-%*:%`(C', instr_2*{instr_2}, `%->%*%`(t_2*{t_2}, x_2*{x_2}, t_3*{t_3})) - ;; 6-typing.watsup:532.1-535.35 - rule sub {C : context, instr* : instr*, it : instrtype, it' : instrtype}: - `%|-%*:%`(C, instr*{instr}, it') - -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, it) - -- Instrtype_sub: `%|-%<:%`(C, it, it') - - ;; 6-typing.watsup:537.1-539.47 - rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%*:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:522.1-523.29 + rule empty {C : context}: + `%|-%*:%`(C, [], `%->%*%`([], [], [])) } ;; 6-typing.watsup:506.1-506.72 @@ -10944,10 +11087,10 @@ rec { ;; 6-typing.watsup:985.1-985.64 def in_binop : (binop_numtype, ibinop*) -> bool - ;; 6-typing.watsup:986.1-986.38 - def {binop : binop_numtype, epsilon : ibinop*} in_binop(binop, epsilon) = false ;; 6-typing.watsup:987.1-987.92 def {binop : binop_numtype, ibinop'* : ibinop*, ibinop_1 : ibinop} in_binop(binop, [ibinop_1] :: ibinop'*{ibinop'}) = ((binop = _I_binop_numtype(ibinop_1)) \/ $in_binop(binop, ibinop'*{ibinop'})) + ;; 6-typing.watsup:986.1-986.38 + def {binop : binop_numtype, epsilon : ibinop*} in_binop(binop, epsilon) = false } ;; 6-typing.watsup:981.1-981.63 @@ -10955,36 +11098,36 @@ rec { ;; 6-typing.watsup:981.1-981.63 def in_numtype : (numtype, numtype*) -> bool - ;; 6-typing.watsup:982.1-982.37 - def {epsilon : numtype*, nt : numtype} in_numtype(nt, epsilon) = false ;; 6-typing.watsup:983.1-983.68 def {nt : numtype, nt'* : numtype*, nt_1 : numtype} in_numtype(nt, [nt_1] :: nt'*{nt'}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt'})) + ;; 6-typing.watsup:982.1-982.37 + def {epsilon : numtype*, nt : numtype} in_numtype(nt, epsilon) = false } ;; 6-typing.watsup:963.1-963.78 relation Instr_const: `%|-%CONST`(context, instr) - ;; 6-typing.watsup:967.1-968.26 - rule const {C : context, c : c, nt : numtype}: - `%|-%CONST`(C, CONST_instr(nt, c)) + ;; 6-typing.watsup:989.1-992.38 + rule binop {C : context, binop : binop_numtype, nt : numtype}: + `%|-%CONST`(C, BINOP_instr(nt, binop)) + -- if $in_numtype(nt, [I32_numtype I64_numtype]) + -- if $in_binop(binop, [ADD_ibinop SUB_ibinop MUL_ibinop]) - ;; 6-typing.watsup:970.1-971.27 - rule ref.null {C : context, ht : heaptype}: - `%|-%CONST`(C, REF.NULL_instr(ht)) + ;; 6-typing.watsup:976.1-978.24 + rule global.get {C : context, t : valtype, x : idx}: + `%|-%CONST`(C, GLOBAL.GET_instr(x)) + -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?()), t)) ;; 6-typing.watsup:973.1-974.26 rule ref.func {C : context, x : idx}: `%|-%CONST`(C, REF.FUNC_instr(x)) - ;; 6-typing.watsup:976.1-978.24 - rule global.get {C : context, t : valtype, x : idx}: - `%|-%CONST`(C, GLOBAL.GET_instr(x)) - -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?()), t)) + ;; 6-typing.watsup:970.1-971.27 + rule ref.null {C : context, ht : heaptype}: + `%|-%CONST`(C, REF.NULL_instr(ht)) - ;; 6-typing.watsup:989.1-992.38 - rule binop {C : context, binop : binop_numtype, nt : numtype}: - `%|-%CONST`(C, BINOP_instr(nt, binop)) - -- if $in_numtype(nt, [I32_numtype I64_numtype]) - -- if $in_binop(binop, [ADD_ibinop SUB_ibinop MUL_ibinop]) + ;; 6-typing.watsup:967.1-968.26 + rule const {C : context, c : c, nt : numtype}: + `%|-%CONST`(C, CONST_instr(nt, c)) ;; 6-typing.watsup:964.1-964.77 relation Expr_const: `%|-%CONST`(context, expr) @@ -11012,16 +11155,16 @@ relation Type_ok: `%|-%:%*`(context, type, deftype*) ;; 6-typing.watsup:1013.1-1013.74 relation Local_ok: `%|-%:%`(context, local, localtype) - ;; 6-typing.watsup:1029.1-1031.28 - rule set {C : context, t : valtype}: - `%|-%:%`(C, LOCAL(t), `%%`(SET_init, t)) - -- if ($default(t) =/= ?()) - ;; 6-typing.watsup:1033.1-1035.26 rule unset {C : context, t : valtype}: `%|-%:%`(C, LOCAL(t), `%%`(UNSET_init, t)) -- if ($default(t) = ?()) + ;; 6-typing.watsup:1029.1-1031.28 + rule set {C : context, t : valtype}: + `%|-%:%`(C, LOCAL(t), `%%`(SET_init, t)) + -- if ($default(t) =/= ?()) + ;; 6-typing.watsup:1012.1-1012.73 relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup:1037.1-1041.82 @@ -11058,19 +11201,19 @@ relation Mem_ok: `%|-%:%`(context, mem, memtype) ;; 6-typing.watsup:1019.1-1019.77 relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) - ;; 6-typing.watsup:1068.1-1071.45 - rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} + ;; 6-typing.watsup:1076.1-1077.20 + rule declare {C : context, rt : reftype}: + `%|-%:%`(C, DECLARE_elemmode, rt) ;; 6-typing.watsup:1073.1-1074.20 rule passive {C : context, rt : reftype}: `%|-%:%`(C, PASSIVE_elemmode, rt) - ;; 6-typing.watsup:1076.1-1077.20 - rule declare {C : context, rt : reftype}: - `%|-%:%`(C, DECLARE_elemmode, rt) + ;; 6-typing.watsup:1068.1-1071.45 + rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup:1017.1-1017.73 relation Elem_ok: `%|-%:%`(context, elem, reftype) @@ -11082,16 +11225,16 @@ relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup:1020.1-1020.77 relation Datamode_ok: `%|-%:OK`(context, datamode) + ;; 6-typing.watsup:1084.1-1085.20 + rule passive {C : context}: + `%|-%:OK`(C, PASSIVE_datamode) + ;; 6-typing.watsup:1079.1-1082.45 rule active {C : context, expr : expr, mt : memtype, x : idx}: `%|-%:OK`(C, ACTIVE_datamode(x, expr)) -- if (C.MEM_context[x] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 6-typing.watsup:1084.1-1085.20 - rule passive {C : context}: - `%|-%:OK`(C, PASSIVE_datamode) - ;; 6-typing.watsup:1018.1-1018.73 relation Data_ok: `%|-%:OK`(context, data) ;; 6-typing.watsup:1064.1-1066.37 @@ -11115,25 +11258,25 @@ relation Import_ok: `%|-%:%`(context, import, externtype) ;; 6-typing.watsup:1096.1-1096.83 relation Externidx_ok: `%|-%:%`(context, externidx, externtype) - ;; 6-typing.watsup:1107.1-1109.23 - rule func {C : context, dt : deftype, x : idx}: - `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) - -- if (C.FUNC_context[x] = dt) - - ;; 6-typing.watsup:1111.1-1113.25 - rule global {C : context, gt : globaltype, x : idx}: - `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) - -- if (C.GLOBAL_context[x] = gt) + ;; 6-typing.watsup:1119.1-1121.22 + rule mem {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) + -- if (C.MEM_context[x] = mt) ;; 6-typing.watsup:1115.1-1117.24 rule table {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE_externidx(x), TABLE_externtype(tt)) -- if (C.TABLE_context[x] = tt) - ;; 6-typing.watsup:1119.1-1121.22 - rule mem {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:1111.1-1113.25 + rule global {C : context, gt : globaltype, x : idx}: + `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) + -- if (C.GLOBAL_context[x] = gt) + + ;; 6-typing.watsup:1107.1-1109.23 + rule func {C : context, dt : deftype, x : idx}: + `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) + -- if (C.FUNC_context[x] = dt) ;; 6-typing.watsup:1095.1-1095.80 relation Export_ok: `%|-%:%`(context, export, externtype) @@ -11147,15 +11290,15 @@ rec { ;; 6-typing.watsup:1128.1-1128.77 relation Globals_ok: `%|-%*:%*`(context, global*, globaltype*) - ;; 6-typing.watsup:1171.1-1172.17 - rule empty {C : context}: - `%|-%*:%*`(C, [], []) - ;; 6-typing.watsup:1174.1-1177.54 rule cons {C : context, global : global, global_1 : global, gt* : globaltype*, gt_1 : globaltype}: `%|-%*:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt}) -- Global_ok: `%|-%:%`(C, global, gt_1) -- Globals_ok: `%|-%*:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt}) + + ;; 6-typing.watsup:1171.1-1172.17 + rule empty {C : context}: + `%|-%*:%*`(C, [], []) } ;; 6-typing.watsup:1127.1-1127.75 @@ -11163,15 +11306,15 @@ rec { ;; 6-typing.watsup:1127.1-1127.75 relation Types_ok: `%|-%*:%*`(context, type*, deftype*) - ;; 6-typing.watsup:1163.1-1164.17 - rule empty {C : context}: - `%|-%*:%*`(C, [], []) - ;; 6-typing.watsup:1166.1-1169.49 rule cons {C : context, dt* : deftype*, dt_1 : deftype, type* : type*, type_1 : type}: `%|-%*:%*`(C, [type_1] :: type*{type}, dt_1*{} :: dt*{dt}) -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) -- Types_ok: `%|-%*:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, dt*{dt}) + + ;; 6-typing.watsup:1163.1-1164.17 + rule empty {C : context}: + `%|-%*:%*`(C, [], []) } ;; 6-typing.watsup:1126.1-1126.76 @@ -11198,474 +11341,485 @@ relation Module_ok: `|-%:OK`(module) ;; 7-runtime-typing.watsup:5.1-5.40 relation Ref_ok: `%|-%:%`(store, ref, reftype) - ;; 7-runtime-typing.watsup:7.1-8.35 - rule null {ht : heaptype, s : store}: - `%|-%:%`(s, REF.NULL_ref(ht), REF_reftype(`NULL%?`(?(())), ht)) + ;; 7-runtime-typing.watsup:28.1-29.45 + rule extern {addrref : addrref, s : store}: + `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) - ;; 7-runtime-typing.watsup:10.1-11.37 - rule i31 {i : nat, s : store}: - `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) + ;; 7-runtime-typing.watsup:25.1-26.39 + rule host {a : addr, s : store}: + `%|-%:%`(s, REF.HOST_ADDR_ref(a), REF_reftype(`NULL%?`(?()), ANY_heaptype)) - ;; 7-runtime-typing.watsup:13.1-15.30 - rule struct {a : addr, dt : deftype, s : store}: - `%|-%:%`(s, REF.STRUCT_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) - -- if (s.STRUCT_store[a].TYPE_structinst = dt) + ;; 7-runtime-typing.watsup:21.1-23.28 + rule func {a : addr, dt : deftype, s : store}: + `%|-%:%`(s, REF.FUNC_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) + -- if (s.FUNC_store[a].TYPE_funcinst = dt) ;; 7-runtime-typing.watsup:17.1-19.29 rule array {a : addr, dt : deftype, s : store}: `%|-%:%`(s, REF.ARRAY_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) -- if (s.ARRAY_store[a].TYPE_arrayinst = dt) - ;; 7-runtime-typing.watsup:21.1-23.28 - rule func {a : addr, dt : deftype, s : store}: - `%|-%:%`(s, REF.FUNC_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) - -- if (s.FUNC_store[a].TYPE_funcinst = dt) + ;; 7-runtime-typing.watsup:13.1-15.30 + rule struct {a : addr, dt : deftype, s : store}: + `%|-%:%`(s, REF.STRUCT_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) + -- if (s.STRUCT_store[a].TYPE_structinst = dt) - ;; 7-runtime-typing.watsup:25.1-26.39 - rule host {a : addr, s : store}: - `%|-%:%`(s, REF.HOST_ADDR_ref(a), REF_reftype(`NULL%?`(?()), ANY_heaptype)) + ;; 7-runtime-typing.watsup:10.1-11.37 + rule i31 {i : nat, s : store}: + `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) - ;; 7-runtime-typing.watsup:28.1-29.45 - rule extern {addrref : addrref, s : store}: - `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) + ;; 7-runtime-typing.watsup:7.1-8.35 + rule null {ht : heaptype, s : store}: + `%|-%:%`(s, REF.NULL_ref(ht), REF_reftype(`NULL%?`(?(())), ht)) ;; 8-reduction.watsup:6.1-6.63 relation Step_pure: `%*~>%*`(admininstr*, admininstr*) - ;; 8-reduction.watsup:42.1-43.24 - rule unreachable: - `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) - - ;; 8-reduction.watsup:45.1-46.15 - rule nop: - `%*~>%*`([NOP_admininstr], []) + ;; 8-reduction.watsup:552.1-553.47 + rule local.tee {val : val, x : idx}: + `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) - ;; 8-reduction.watsup:48.1-49.20 - rule drop {val : val}: - `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) + ;; 8-reduction.watsup:539.1-540.55 + rule any.convert_extern-addr {addrref : addrref}: + `%*~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [$admininstr_addrref(addrref)]) - ;; 8-reduction.watsup:52.1-54.16 - rule select-true {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: - `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_1)]) - -- if (c =/= 0) + ;; 8-reduction.watsup:536.1-537.55 + rule any.convert_extern-null {ht : heaptype}: + `%*~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) - ;; 8-reduction.watsup:56.1-58.14 - rule select-false {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: - `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_2)]) - -- if (c = 0) + ;; 8-reduction.watsup:532.1-533.55 + rule extern.convert_any-addr {addrref : addrref}: + `%*~>%*`([$admininstr_addrref(addrref) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) - ;; 8-reduction.watsup:76.1-78.16 - rule if-true {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) - -- if (c =/= 0) + ;; 8-reduction.watsup:529.1-530.58 + rule extern.convert_any-null {ht : heaptype}: + `%*~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) - ;; 8-reduction.watsup:80.1-82.14 - rule if-false {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) - -- if (c = 0) + ;; 8-reduction.watsup:311.1-312.68 + rule i31.get-num {i : nat, sx : sx}: + `%*~>%*`([REF.I31_NUM_admininstr(i) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, i))]) - ;; 8-reduction.watsup:85.1-86.38 - rule label-vals {instr* : instr*, n : n, val* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) - - ;; 8-reduction.watsup:92.1-93.69 - rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) - - ;; 8-reduction.watsup:95.1-96.65 - rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) + ;; 8-reduction.watsup:308.1-309.39 + rule i31.get-null {ht : heaptype, sx : sx}: + `%*~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) - ;; 8-reduction.watsup:99.1-101.16 - rule br_if-true {c : c, l : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) - -- if (c =/= 0) + ;; 8-reduction.watsup:281.1-283.15 + rule ref.eq-false {ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 0)]) + -- otherwise - ;; 8-reduction.watsup:103.1-105.14 - rule br_if-false {c : c, l : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) - -- if (c = 0) + ;; 8-reduction.watsup:276.1-279.22 + rule ref.eq-true {ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- otherwise + -- if (ref_1 = ref_2) - ;; 8-reduction.watsup:108.1-110.17 - rule br_table-lt {i : nat, l* : labelidx*, l' : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) - -- if (i < |l*{l}|) + ;; 8-reduction.watsup:272.1-274.55 + rule ref.eq-null {ht_1 : heaptype, ht_2 : heaptype, ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) - ;; 8-reduction.watsup:112.1-114.18 - rule br_table-ge {i : nat, l* : labelidx*, l' : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) - -- if (i >= |l*{l}|) + ;; 8-reduction.watsup:267.1-269.15 + rule ref.as_non_null-addr {ref : ref}: + `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [$admininstr_ref(ref)]) + -- otherwise - ;; 8-reduction.watsup:117.1-119.26 - rule br_on_null-null {ht : heaptype, l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) - -- if (val = REF.NULL_val(ht)) + ;; 8-reduction.watsup:263.1-265.28 + rule ref.as_non_null-null {ht : heaptype, ref : ref}: + `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) + -- if (ref = REF.NULL_ref(ht)) - ;; 8-reduction.watsup:121.1-123.15 - rule br_on_null-addr {l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [$admininstr_val(val)]) + ;; 8-reduction.watsup:258.1-260.15 + rule ref.is_null-false {val : val}: + `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 8-reduction.watsup:126.1-128.26 - rule br_on_non_null-null {ht : heaptype, l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], []) + ;; 8-reduction.watsup:254.1-256.28 + rule ref.is_null-true {ht : heaptype, val : val}: + `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:130.1-132.15 - rule br_on_non_null-addr {l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], [$admininstr_val(val) BR_admininstr(l)]) - -- otherwise - - ;; 8-reduction.watsup:186.1-187.84 - rule call_indirect-call {x : idx, y : idx}: - `%*~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) CALL_REF_admininstr(?(y))]) + ;; 8-reduction.watsup:250.1-251.60 + rule ref.i31 {i : nat}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, i))]) - ;; 8-reduction.watsup:189.1-190.98 - rule return_call_indirect {x : idx, y : idx}: - `%*~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) RETURN_CALL_REF_admininstr(?(y))]) + ;; 8-reduction.watsup:240.1-242.50 + rule cvtop-trap {c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: + `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) + -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = []) - ;; 8-reduction.watsup:193.1-194.35 - rule frame-vals {f : frame, n : n, val^n : val^n}: - `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) + ;; 8-reduction.watsup:236.1-238.48 + rule cvtop-val {c : c, c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: + `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) + -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = [c]) - ;; 8-reduction.watsup:196.1-197.55 - rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: - `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) + ;; 8-reduction.watsup:232.1-233.70 + rule extend {c : c, n : n, nt : numtype}: + `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, !($size($valtype_numtype(nt))), S_sx, c))]) - ;; 8-reduction.watsup:199.1-200.60 - rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: - `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) + ;; 8-reduction.watsup:227.1-229.40 + rule relop {c : c, c_1 : c, c_2 : c, nt : numtype, relop : relop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) + -- if (c = $relop(relop, nt, c_1, c_2)) - ;; 8-reduction.watsup:205.1-207.33 - rule unop-val {c : c, c_1 : c, nt : numtype, unop : unop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) - -- if ($unop(unop, nt, c_1) = [c]) + ;; 8-reduction.watsup:223.1-225.37 + rule testop {c : c, c_1 : c, nt : numtype, testop : testop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) + -- if (c = $testop(testop, nt, c_1)) - ;; 8-reduction.watsup:209.1-211.35 - rule unop-trap {c_1 : c, nt : numtype, unop : unop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) - -- if ($unop(unop, nt, c_1) = []) + ;; 8-reduction.watsup:218.1-220.42 + rule binop-trap {binop : binop_numtype, c_1 : c, c_2 : c, nt : numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) + -- if ($binop(binop, nt, c_1, c_2) = []) ;; 8-reduction.watsup:214.1-216.40 rule binop-val {binop : binop_numtype, c : c, c_1 : c, c_2 : c, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(binop, nt, c_1, c_2) = [c]) - ;; 8-reduction.watsup:218.1-220.42 - rule binop-trap {binop : binop_numtype, c_1 : c, c_2 : c, nt : numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) - -- if ($binop(binop, nt, c_1, c_2) = []) - - ;; 8-reduction.watsup:223.1-225.37 - rule testop {c : c, c_1 : c, nt : numtype, testop : testop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) - -- if (c = $testop(testop, nt, c_1)) + ;; 8-reduction.watsup:209.1-211.35 + rule unop-trap {c_1 : c, nt : numtype, unop : unop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) + -- if ($unop(unop, nt, c_1) = []) - ;; 8-reduction.watsup:227.1-229.40 - rule relop {c : c, c_1 : c, c_2 : c, nt : numtype, relop : relop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) - -- if (c = $relop(relop, nt, c_1, c_2)) + ;; 8-reduction.watsup:205.1-207.33 + rule unop-val {c : c, c_1 : c, nt : numtype, unop : unop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) + -- if ($unop(unop, nt, c_1) = [c]) - ;; 8-reduction.watsup:232.1-233.70 - rule extend {c : c, n : n, nt : numtype}: - `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, !($size($valtype_numtype(nt))), S_sx, c))]) + ;; 8-reduction.watsup:199.1-200.60 + rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: + `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) - ;; 8-reduction.watsup:236.1-238.48 - rule cvtop-val {c : c, c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: - `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) - -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = [c]) + ;; 8-reduction.watsup:196.1-197.55 + rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: + `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) - ;; 8-reduction.watsup:240.1-242.50 - rule cvtop-trap {c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: - `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) - -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = []) + ;; 8-reduction.watsup:193.1-194.35 + rule frame-vals {f : frame, n : n, val^n : val^n}: + `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) - ;; 8-reduction.watsup:250.1-251.60 - rule ref.i31 {i : nat}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, i))]) + ;; 8-reduction.watsup:189.1-190.98 + rule return_call_indirect {x : idx, y : idx}: + `%*~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) RETURN_CALL_REF_admininstr(?(y))]) - ;; 8-reduction.watsup:254.1-256.28 - rule ref.is_null-true {ht : heaptype, val : val}: - `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- if (val = REF.NULL_val(ht)) + ;; 8-reduction.watsup:186.1-187.84 + rule call_indirect-call {x : idx, y : idx}: + `%*~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) CALL_REF_admininstr(?(y))]) - ;; 8-reduction.watsup:258.1-260.15 - rule ref.is_null-false {val : val}: - `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) + ;; 8-reduction.watsup:130.1-132.15 + rule br_on_non_null-addr {l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], [$admininstr_val(val) BR_admininstr(l)]) -- otherwise - ;; 8-reduction.watsup:263.1-265.28 - rule ref.as_non_null-null {ht : heaptype, ref : ref}: - `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) - -- if (ref = REF.NULL_ref(ht)) + ;; 8-reduction.watsup:126.1-128.26 + rule br_on_non_null-null {ht : heaptype, l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], []) + -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:267.1-269.15 - rule ref.as_non_null-addr {ref : ref}: - `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [$admininstr_ref(ref)]) + ;; 8-reduction.watsup:121.1-123.15 + rule br_on_null-addr {l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [$admininstr_val(val)]) -- otherwise - ;; 8-reduction.watsup:272.1-274.55 - rule ref.eq-null {ht_1 : heaptype, ht_2 : heaptype, ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) - - ;; 8-reduction.watsup:276.1-279.22 - rule ref.eq-true {ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- otherwise - -- if (ref_1 = ref_2) + ;; 8-reduction.watsup:117.1-119.26 + rule br_on_null-null {ht : heaptype, l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) + -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:281.1-283.15 - rule ref.eq-false {ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 0)]) - -- otherwise + ;; 8-reduction.watsup:112.1-114.18 + rule br_table-ge {i : nat, l* : labelidx*, l' : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) + -- if (i >= |l*{l}|) - ;; 8-reduction.watsup:308.1-309.39 - rule i31.get-null {ht : heaptype, sx : sx}: - `%*~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) + ;; 8-reduction.watsup:108.1-110.17 + rule br_table-lt {i : nat, l* : labelidx*, l' : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) + -- if (i < |l*{l}|) - ;; 8-reduction.watsup:311.1-312.68 - rule i31.get-num {i : nat, sx : sx}: - `%*~>%*`([REF.I31_NUM_admininstr(i) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, i))]) + ;; 8-reduction.watsup:103.1-105.14 + rule br_if-false {c : c, l : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) + -- if (c = 0) - ;; 8-reduction.watsup:529.1-530.58 - rule extern.convert_any-null {ht : heaptype}: - `%*~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) + ;; 8-reduction.watsup:99.1-101.16 + rule br_if-true {c : c, l : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) + -- if (c =/= 0) - ;; 8-reduction.watsup:532.1-533.55 - rule extern.convert_any-addr {addrref : addrref}: - `%*~>%*`([$admininstr_addrref(addrref) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) + ;; 8-reduction.watsup:95.1-96.65 + rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) - ;; 8-reduction.watsup:536.1-537.55 - rule any.convert_extern-null {ht : heaptype}: - `%*~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) + ;; 8-reduction.watsup:92.1-93.69 + rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) - ;; 8-reduction.watsup:539.1-540.55 - rule any.convert_extern-addr {addrref : addrref}: - `%*~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [$admininstr_addrref(addrref)]) + ;; 8-reduction.watsup:85.1-86.38 + rule label-vals {instr* : instr*, n : n, val* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) - ;; 8-reduction.watsup:552.1-553.47 - rule local.tee {val : val, x : idx}: - `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) + ;; 8-reduction.watsup:80.1-82.14 + rule if-false {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) + -- if (c = 0) + + ;; 8-reduction.watsup:76.1-78.16 + rule if-true {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) + -- if (c =/= 0) + + ;; 8-reduction.watsup:56.1-58.14 + rule select-false {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: + `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_2)]) + -- if (c = 0) + + ;; 8-reduction.watsup:52.1-54.16 + rule select-true {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: + `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_1)]) + -- if (c =/= 0) + + ;; 8-reduction.watsup:48.1-49.20 + rule drop {val : val}: + `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) + + ;; 8-reduction.watsup:45.1-46.15 + rule nop: + `%*~>%*`([NOP_admininstr], []) + + ;; 8-reduction.watsup:42.1-43.24 + rule unreachable: + `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) ;; 8-reduction.watsup:63.1-63.73 def blocktype : (state, blocktype) -> functype - ;; 8-reduction.watsup:64.1-64.44 - def {z : state} blocktype(z, _RESULT_blocktype(?())) = `%->%`([], []) - ;; 8-reduction.watsup:65.1-65.40 - def {t : valtype, z : state} blocktype(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) ;; 8-reduction.watsup:66.1-66.66 def {ft : functype, x : idx, z : state} blocktype(z, _IDX_blocktype(x)) = ft -- Expand: `%~~%`($type(z, x), FUNC_comptype(ft)) + ;; 8-reduction.watsup:65.1-65.40 + def {t : valtype, z : state} blocktype(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) + ;; 8-reduction.watsup:64.1-64.44 + def {z : state} blocktype(z, _RESULT_blocktype(?())) = `%->%`([], []) ;; 8-reduction.watsup:7.1-7.63 relation Step_read: `%~>%*`(config, admininstr*) - ;; 8-reduction.watsup:68.1-70.43 - rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + ;; 8-reduction.watsup:753.1-757.15 + rule memory.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, y).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x, y)]) + -- otherwise - ;; 8-reduction.watsup:72.1-74.43 - rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + ;; 8-reduction.watsup:748.1-751.14 + rule memory.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:135.1-138.66 - rule br_on_cast-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt) - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) + ;; 8-reduction.watsup:744.1-746.70 + rule memory.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) - ;; 8-reduction.watsup:140.1-142.15 - rule br_on_cast-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) + ;; 8-reduction.watsup:737.1-741.15 + rule memory.copy-gt {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise - ;; 8-reduction.watsup:145.1-148.66 - rule br_on_cast_fail-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt) - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) + ;; 8-reduction.watsup:730.1-735.19 + rule memory.copy-le {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, (i_1 + 1)) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) + -- otherwise + -- if (i_1 <= i_2) - ;; 8-reduction.watsup:150.1-152.15 - rule br_on_cast_fail-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) + ;; 8-reduction.watsup:725.1-728.14 + rule memory.copy-zero {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), []) -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:157.1-158.62 - rule call {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) CALL_REF_admininstr(?())]) + ;; 8-reduction.watsup:721.1-723.77 + rule memory.copy-oob {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) - ;; 8-reduction.watsup:160.1-161.43 - rule call_ref-null {ht : heaptype, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) + ;; 8-reduction.watsup:714.1-718.15 + rule memory.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr(x)]) + -- otherwise - ;; 8-reduction.watsup:163.1-168.59 - rule call_ref-func {a : addr, f : frame, fi : funcinst, instr* : instr*, m : m, n : n, t* : valtype*, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, x? : idx?, y : idx, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], $admininstr_instr(instr)*{instr})])]) - -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) - -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) + ;; 8-reduction.watsup:709.1-712.14 + rule memory.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:171.1-172.76 - rule return_call {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) RETURN_CALL_REF_admininstr(?())]) + ;; 8-reduction.watsup:705.1-707.37 + rule memory.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:175.1-176.78 - rule return_call_ref-frame-null {f : frame, ht : heaptype, instr* : instr*, k : nat, val* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), [TRAP_admininstr]) + ;; 8-reduction.watsup:692.1-694.44 + rule memory.size {n : n, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) + -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:178.1-180.59 - rule return_call_ref-frame-addr {a : addr, f : frame, instr* : instr*, k : nat, m : m, n : n, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, val'* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + ;; 8-reduction.watsup:670.1-672.61 + rule load-pack-val {c : c, i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [CONST_admininstr(nt, $ext(n, !($size($valtype_numtype(nt))), sx, c))]) + -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) - ;; 8-reduction.watsup:182.1-183.91 - rule return_call_ref-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) + ;; 8-reduction.watsup:666.1-668.51 + rule load-pack-oob {i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [TRAP_admininstr]) + -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:247.1-248.55 - rule ref.func {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) + ;; 8-reduction.watsup:662.1-664.71 + rule load-num-val {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) + -- if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (!($size($valtype_numtype(nt))) / 8)]) - ;; 8-reduction.watsup:286.1-289.65 - rule ref.test-true {ref : ref, rt : reftype, rt' : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 1)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt') - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) + ;; 8-reduction.watsup:658.1-660.59 + rule load-num-oob {i : nat, mo : memop, nt : numtype, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) + -- if (((i + mo.OFFSET_memop) + (!($size($valtype_numtype(nt))) / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:291.1-293.15 - rule ref.test-false {ref : ref, rt : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 0)]) + ;; 8-reduction.watsup:645.1-649.15 + rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.INIT_admininstr(x, y)]) -- otherwise - ;; 8-reduction.watsup:296.1-299.65 - rule ref.cast-succeed {ref : ref, rt : reftype, rt' : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [$admininstr_ref(ref)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt') - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) - - ;; 8-reduction.watsup:301.1-303.15 - rule ref.cast-fail {ref : ref, rt : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:640.1-643.14 + rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), []) -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:322.1-325.43 - rule struct.new_default {mut* : mut*, val* : val*, x : idx, z : state, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)*{val} :: [STRUCT.NEW_admininstr(x)]) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} + ;; 8-reduction.watsup:636.1-638.72 + rule table.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) - ;; 8-reduction.watsup:328.1-329.50 - rule struct.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:629.1-633.15 + rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) + -- otherwise - ;; 8-reduction.watsup:331.1-334.41 - rule struct.get-struct {a : addr, i : nat, mut* : mut*, si : structinst, sx? : sx?, x : idx, z : state, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [$admininstr_val($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]))]) - -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + ;; 8-reduction.watsup:622.1-627.15 + rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) + -- otherwise + -- if (j <= i) - ;; 8-reduction.watsup:348.1-349.70 - rule array.new {n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.NEW_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + ;; 8-reduction.watsup:617.1-620.14 + rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:351.1-354.40 - rule array.new_default {mut : mut, n : n, val : val, x : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) ARRAY.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ($default($unpacktype(zt)) = ?(val)) + ;; 8-reduction.watsup:613.1-615.73 + rule table.copy-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) - ;; 8-reduction.watsup:362.1-364.38 - rule array.new_elem-oob {i : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) + ;; 8-reduction.watsup:606.1-610.15 + rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) + -- otherwise - ;; 8-reduction.watsup:366.1-368.40 - rule array.new_elem-alloc {i : nat, n : n, ref^n : ref^n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), $admininstr_ref(ref)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) + ;; 8-reduction.watsup:601.1-604.14 + rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:371.1-374.59 - rule array.new_data-oob {i : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) + ;; 8-reduction.watsup:597.1-599.39 + rule table.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:376.1-380.88 - rule array.new_data-alloc {c^n : c^n, i : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (nt = $unpacknumtype(zt)) - -- if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) + ;; 8-reduction.watsup:584.1-586.32 + rule table.size {n : n, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) + -- if (|$table(z, x).ELEM_tableinst| = n) - ;; 8-reduction.watsup:383.1-384.61 - rule array.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:571.1-573.32 + rule table.get-val {i : nat, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) + -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:386.1-388.38 - rule array.get-oob {a : addr, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) - -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:567.1-569.33 + rule table.get-oob {i : nat, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) + -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:390.1-393.53 - rule array.get-array {a : addr, fv : fieldval, i : nat, mut : mut, sx? : sx?, x : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [$admininstr_val($unpackval(zt, sx?{sx}, fv))]) - -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) - -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) + ;; 8-reduction.watsup:558.1-559.45 + rule global.get {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) - ;; 8-reduction.watsup:409.1-410.39 - rule array.len-null {ht : heaptype, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) + ;; 8-reduction.watsup:545.1-547.27 + rule local.get {val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val(val)]) + -- if ($local(z, x) = ?(val)) - ;; 8-reduction.watsup:412.1-414.37 - rule array.len-array {a : addr, n : n, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, n)]) - -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:517.1-524.67 + rule array.init_data-succ {a : addr, c : c, i : nat, j : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + ($storagesize(zt) / 8))) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_DATA_admininstr(x, y)]) + -- otherwise + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (nt = $unpacknumtype(zt)) + -- if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) - ;; 8-reduction.watsup:417.1-418.76 - rule array.fill-null {ht : heaptype, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:512.1-515.14 + rule array.init_data-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:420.1-422.44 - rule array.fill-oob {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:507.1-510.59 + rule array.init_data-oob2 {a : addr, i : nat, j : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) + + ;; 8-reduction.watsup:503.1-505.44 + rule array.init_data-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:424.1-427.14 - rule array.fill-zero {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:500.1-501.93 + rule array.init_data-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:429.1-433.15 - rule array.fill-succ {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.FILL_admininstr(x)]) + ;; 8-reduction.watsup:492.1-497.34 + rule array.init_elem-succ {a : addr, i : nat, j : nat, n : n, ref : ref, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_ELEM_admininstr(x, y)]) -- otherwise + -- if (ref = $elem(z, y).ELEM_eleminst[j]) - ;; 8-reduction.watsup:435.1-436.102 - rule array.copy-null1 {ht_1 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, i_1) $admininstr_ref(ref) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:487.1-490.14 + rule array.init_elem-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:438.1-439.102 - rule array.copy-null2 {ht_2 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, i_1) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:483.1-485.38 + rule array.init_elem-oob2 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) - ;; 8-reduction.watsup:441.1-443.48 - rule array.copy-oob1 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) + ;; 8-reduction.watsup:479.1-481.44 + rule array.init_elem-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:445.1-447.48 - rule array.copy-oob2 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) + ;; 8-reduction.watsup:476.1-477.93 + rule array.init_elem-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:449.1-452.14 - rule array.copy-zero {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), []) + ;; 8-reduction.watsup:465.1-473.29 + rule array.copy-gt {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise - -- if (n = 0) + -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) + -- if (sx?{sx} = $sxfield(zt_2)) ;; 8-reduction.watsup:454.1-463.19 rule array.copy-le {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: @@ -11675,352 +11829,341 @@ relation Step_read: `%~>%*`(config, admininstr*) -- if (sx?{sx} = $sxfield(zt_2)) -- if (i_1 <= i_2) - ;; 8-reduction.watsup:465.1-473.29 - rule array.copy-gt {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) + ;; 8-reduction.watsup:449.1-452.14 + rule array.copy-zero {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), []) -- otherwise - -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (n = 0) - ;; 8-reduction.watsup:476.1-477.93 - rule array.init_elem-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:445.1-447.48 + rule array.copy-oob2 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) - ;; 8-reduction.watsup:479.1-481.44 - rule array.init_elem-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:441.1-443.48 + rule array.copy-oob1 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) - ;; 8-reduction.watsup:483.1-485.38 - rule array.init_elem-oob2 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) + ;; 8-reduction.watsup:438.1-439.102 + rule array.copy-null2 {ht_2 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, i_1) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:487.1-490.14 - rule array.init_elem-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:435.1-436.102 + rule array.copy-null1 {ht_1 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, i_1) $admininstr_ref(ref) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:492.1-497.34 - rule array.init_elem-succ {a : addr, i : nat, j : nat, n : n, ref : ref, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_ELEM_admininstr(x, y)]) + ;; 8-reduction.watsup:429.1-433.15 + rule array.fill-succ {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.FILL_admininstr(x)]) -- otherwise - -- if (ref = $elem(z, y).ELEM_eleminst[j]) - ;; 8-reduction.watsup:500.1-501.93 - rule array.init_data-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:424.1-427.14 + rule array.fill-zero {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:503.1-505.44 - rule array.init_data-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:420.1-422.44 + rule array.fill-oob {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:507.1-510.59 - rule array.init_data-oob2 {a : addr, i : nat, j : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) + ;; 8-reduction.watsup:417.1-418.76 + rule array.fill-null {ht : heaptype, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:512.1-515.14 - rule array.init_data-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:412.1-414.37 + rule array.len-array {a : addr, n : n, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, n)]) + -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:517.1-524.67 - rule array.init_data-succ {a : addr, c : c, i : nat, j : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + ($storagesize(zt) / 8))) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_DATA_admininstr(x, y)]) - -- otherwise - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (nt = $unpacknumtype(zt)) - -- if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) + ;; 8-reduction.watsup:409.1-410.39 + rule array.len-null {ht : heaptype, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) - ;; 8-reduction.watsup:545.1-547.27 - rule local.get {val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val(val)]) - -- if ($local(z, x) = ?(val)) + ;; 8-reduction.watsup:390.1-393.53 + rule array.get-array {a : addr, fv : fieldval, i : nat, mut : mut, sx? : sx?, x : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [$admininstr_val($unpackval(zt, sx?{sx}, fv))]) + -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) + -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) - ;; 8-reduction.watsup:558.1-559.45 - rule global.get {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) + ;; 8-reduction.watsup:386.1-388.38 + rule array.get-oob {a : addr, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:567.1-569.33 - rule table.get-oob {i : nat, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) - -- if (i >= |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:383.1-384.61 + rule array.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:571.1-573.32 - rule table.get-val {i : nat, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) - -- if (i < |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:376.1-380.88 + rule array.new_data-alloc {c^n : c^n, i : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (nt = $unpacknumtype(zt)) + -- if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) - ;; 8-reduction.watsup:584.1-586.32 - rule table.size {n : n, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) - -- if (|$table(z, x).ELEM_tableinst| = n) + ;; 8-reduction.watsup:371.1-374.59 + rule array.new_data-oob {i : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) - ;; 8-reduction.watsup:597.1-599.39 - rule table.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:366.1-368.40 + rule array.new_elem-alloc {i : nat, n : n, ref^n : ref^n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), $admininstr_ref(ref)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) - ;; 8-reduction.watsup:601.1-604.14 - rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) - - ;; 8-reduction.watsup:606.1-610.15 - rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) - -- otherwise + ;; 8-reduction.watsup:362.1-364.38 + rule array.new_elem-oob {i : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) - ;; 8-reduction.watsup:613.1-615.73 - rule table.copy-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) + ;; 8-reduction.watsup:351.1-354.40 + rule array.new_default {mut : mut, n : n, val : val, x : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) ARRAY.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ($default($unpacktype(zt)) = ?(val)) - ;; 8-reduction.watsup:617.1-620.14 - rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:348.1-349.70 + rule array.new {n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.NEW_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - ;; 8-reduction.watsup:622.1-627.15 - rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) - -- otherwise - -- if (j <= i) + ;; 8-reduction.watsup:331.1-334.41 + rule struct.get-struct {a : addr, i : nat, mut* : mut*, si : structinst, sx? : sx?, x : idx, z : state, zt* : storagetype*}: + `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [$admininstr_val($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]))]) + -- if ($structinst(z)[a] = si) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - ;; 8-reduction.watsup:629.1-633.15 - rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) - -- otherwise + ;; 8-reduction.watsup:328.1-329.50 + rule struct.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:636.1-638.72 - rule table.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) + ;; 8-reduction.watsup:322.1-325.43 + rule struct.new_default {mut* : mut*, val* : val*, x : idx, z : state, zt* : storagetype*}: + `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)*{val} :: [STRUCT.NEW_admininstr(x)]) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} - ;; 8-reduction.watsup:640.1-643.14 - rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), []) + ;; 8-reduction.watsup:301.1-303.15 + rule ref.cast-fail {ref : ref, rt : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) -- otherwise - -- if (n = 0) - ;; 8-reduction.watsup:645.1-649.15 - rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.INIT_admininstr(x, y)]) + ;; 8-reduction.watsup:296.1-299.65 + rule ref.cast-succeed {ref : ref, rt : reftype, rt' : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [$admininstr_ref(ref)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt') + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) + + ;; 8-reduction.watsup:291.1-293.15 + rule ref.test-false {ref : ref, rt : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 8-reduction.watsup:658.1-660.59 - rule load-num-oob {i : nat, mo : memop, nt : numtype, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) - -- if (((i + mo.OFFSET_memop) + (!($size($valtype_numtype(nt))) / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:286.1-289.65 + rule ref.test-true {ref : ref, rt : reftype, rt' : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 1)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt') + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) - ;; 8-reduction.watsup:662.1-664.71 - rule load-num-val {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) - -- if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (!($size($valtype_numtype(nt))) / 8)]) + ;; 8-reduction.watsup:247.1-248.55 + rule ref.func {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) - ;; 8-reduction.watsup:666.1-668.51 - rule load-pack-oob {i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [TRAP_admininstr]) - -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:182.1-183.91 + rule return_call_ref-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) - ;; 8-reduction.watsup:670.1-672.61 - rule load-pack-val {c : c, i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [CONST_admininstr(nt, $ext(n, !($size($valtype_numtype(nt))), sx, c))]) - -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) + ;; 8-reduction.watsup:178.1-180.59 + rule return_call_ref-frame-addr {a : addr, f : frame, instr* : instr*, k : nat, m : m, n : n, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, val'* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - ;; 8-reduction.watsup:692.1-694.44 - rule memory.size {n : n, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) - -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:175.1-176.78 + rule return_call_ref-frame-null {f : frame, ht : heaptype, instr* : instr*, k : nat, val* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), [TRAP_admininstr]) - ;; 8-reduction.watsup:705.1-707.37 - rule memory.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:171.1-172.76 + rule return_call {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) RETURN_CALL_REF_admininstr(?())]) - ;; 8-reduction.watsup:709.1-712.14 - rule memory.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:163.1-168.59 + rule call_ref-func {a : addr, f : frame, fi : funcinst, instr* : instr*, m : m, n : n, t* : valtype*, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, x? : idx?, y : idx, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], $admininstr_instr(instr)*{instr})])]) + -- if ($funcinst(z)[a] = fi) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) + -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) - ;; 8-reduction.watsup:714.1-718.15 - rule memory.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr(x)]) - -- otherwise + ;; 8-reduction.watsup:160.1-161.43 + rule call_ref-null {ht : heaptype, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) - ;; 8-reduction.watsup:721.1-723.77 - rule memory.copy-oob {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) + ;; 8-reduction.watsup:157.1-158.62 + rule call {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) CALL_REF_admininstr(?())]) - ;; 8-reduction.watsup:725.1-728.14 - rule memory.copy-zero {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), []) + ;; 8-reduction.watsup:150.1-152.15 + rule br_on_cast_fail-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) -- otherwise - -- if (n = 0) - ;; 8-reduction.watsup:730.1-735.19 - rule memory.copy-le {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, (i_1 + 1)) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) - -- otherwise - -- if (i_1 <= i_2) + ;; 8-reduction.watsup:145.1-148.66 + rule br_on_cast_fail-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt) + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) - ;; 8-reduction.watsup:737.1-741.15 - rule memory.copy-gt {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) + ;; 8-reduction.watsup:140.1-142.15 + rule br_on_cast-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) -- otherwise - ;; 8-reduction.watsup:744.1-746.70 - rule memory.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) + ;; 8-reduction.watsup:135.1-138.66 + rule br_on_cast-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt) + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) - ;; 8-reduction.watsup:748.1-751.14 - rule memory.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:72.1-74.43 + rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 8-reduction.watsup:753.1-757.15 - rule memory.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, y).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x, y)]) - -- otherwise + ;; 8-reduction.watsup:68.1-70.43 + rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) ;; 8-reduction.watsup:5.1-5.63 relation Step: `%~>%`(config, config) - ;; 8-reduction.watsup:10.1-12.34 - rule pure {instr* : instr*, instr'* : instr*, z : state}: - `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) - -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) - - ;; 8-reduction.watsup:14.1-16.37 - rule read {instr* : instr*, instr'* : instr*, z : state}: - `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) - -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) + ;; 8-reduction.watsup:760.1-761.51 + rule data.drop {x : idx, z : state}: + `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) - ;; 8-reduction.watsup:317.1-320.61 - rule struct.new {mut^n : mut^n, n : n, si : structinst, val^n : val^n, x : idx, z : state, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) - -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) + ;; 8-reduction.watsup:701.1-702.77 + rule memory.grow-fail {n : n, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) - ;; 8-reduction.watsup:337.1-338.53 - rule struct.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`(z, [TRAP_admininstr])) + ;; 8-reduction.watsup:697.1-699.40 + rule memory.grow-succeed {mi : meminst, n : n, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, (|$mem(z, x).DATA_meminst| / (64 * $Ki)))])) + -- if (mi = !($growmemory($mem(z, x), n))) - ;; 8-reduction.watsup:340.1-343.35 - rule struct.set-struct {a : addr, fv : fieldval, i : nat, mut* : mut*, val : val, x : idx, z : state, zt* : storagetype*}: - `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`($with_struct(z, a, i, fv), [])) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + ;; 8-reduction.watsup:687.1-689.48 + rule store-pack-val {b* : byte*, c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (n / 8), b*{b}), [])) + -- if (b*{b} = $ibytes(n, $wrap(!($size($valtype_numtype(nt))), n, c))) - ;; 8-reduction.watsup:356.1-359.61 - rule array.new_fixed {ai : arrayinst, mut : mut, n : n, val^n : val^n, x : idx, z : state, zt : storagetype}: - `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) + ;; 8-reduction.watsup:683.1-685.51 + rule store-pack-oob {c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:396.1-397.64 - rule array.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + ;; 8-reduction.watsup:679.1-681.29 + rule store-num-val {b* : byte*, c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (!($size($valtype_numtype(nt))) / 8), b*{b}), [])) + -- if (b*{b} = $ntbytes(nt, c)) - ;; 8-reduction.watsup:399.1-401.38 - rule array.set-oob {a : addr, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) - -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:675.1-677.59 + rule store-num-oob {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + -- if (((i + mo.OFFSET_memop) + (!($size($valtype_numtype(nt))) / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:403.1-406.31 - rule array.set-array {a : addr, fv : fieldval, i : nat, mut : mut, val : val, x : idx, z : state, zt : storagetype}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) - -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) - -- if (fv = $packval(zt, val)) + ;; 8-reduction.watsup:652.1-653.51 + rule elem.drop {x : idx, z : state}: + `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) - ;; 8-reduction.watsup:549.1-550.56 - rule local.set {val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) + ;; 8-reduction.watsup:593.1-594.80 + rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) - ;; 8-reduction.watsup:561.1-562.58 - rule global.set {val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) + ;; 8-reduction.watsup:589.1-591.46 + rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) + -- if (ti = !($growtable($table(z, x), n, ref))) + + ;; 8-reduction.watsup:579.1-581.32 + rule table.set-val {i : nat, ref : ref, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) + -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup:575.1-577.33 rule table.set-oob {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:579.1-581.32 - rule table.set-val {i : nat, ref : ref, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) - -- if (i < |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:561.1-562.58 + rule global.set {val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) - ;; 8-reduction.watsup:589.1-591.46 - rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) - -- if (ti = !($growtable($table(z, x), n, ref))) + ;; 8-reduction.watsup:549.1-550.56 + rule local.set {val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) - ;; 8-reduction.watsup:593.1-594.80 - rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) + ;; 8-reduction.watsup:403.1-406.31 + rule array.set-array {a : addr, fv : fieldval, i : nat, mut : mut, val : val, x : idx, z : state, zt : storagetype}: + `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) + -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) + -- if (fv = $packval(zt, val)) - ;; 8-reduction.watsup:652.1-653.51 - rule elem.drop {x : idx, z : state}: - `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) + ;; 8-reduction.watsup:399.1-401.38 + rule array.set-oob {a : addr, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:675.1-677.59 - rule store-num-oob {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if (((i + mo.OFFSET_memop) + (!($size($valtype_numtype(nt))) / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:396.1-397.64 + rule array.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) - ;; 8-reduction.watsup:679.1-681.29 - rule store-num-val {b* : byte*, c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (!($size($valtype_numtype(nt))) / 8), b*{b}), [])) - -- if (b*{b} = $ntbytes(nt, c)) + ;; 8-reduction.watsup:356.1-359.61 + rule array.new_fixed {ai : arrayinst, mut : mut, n : n, val^n : val^n, x : idx, z : state, zt : storagetype}: + `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) - ;; 8-reduction.watsup:683.1-685.51 - rule store-pack-oob {c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:340.1-343.35 + rule struct.set-struct {a : addr, fv : fieldval, i : nat, mut* : mut*, val : val, x : idx, z : state, zt* : storagetype*}: + `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`($with_struct(z, a, i, fv), [])) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- if (fv = $packval(zt*{zt}[i], val)) - ;; 8-reduction.watsup:687.1-689.48 - rule store-pack-val {b* : byte*, c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (n / 8), b*{b}), [])) - -- if (b*{b} = $ibytes(n, $wrap(!($size($valtype_numtype(nt))), n, c))) + ;; 8-reduction.watsup:337.1-338.53 + rule struct.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`(z, [TRAP_admininstr])) - ;; 8-reduction.watsup:697.1-699.40 - rule memory.grow-succeed {mi : meminst, n : n, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, (|$mem(z, x).DATA_meminst| / (64 * $Ki)))])) - -- if (mi = !($growmemory($mem(z, x), n))) + ;; 8-reduction.watsup:317.1-320.61 + rule struct.new {mut^n : mut^n, n : n, si : structinst, val^n : val^n, x : idx, z : state, zt^n : storagetype^n}: + `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) + -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) - ;; 8-reduction.watsup:701.1-702.77 - rule memory.grow-fail {n : n, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) + ;; 8-reduction.watsup:14.1-16.37 + rule read {instr* : instr*, instr'* : instr*, z : state}: + `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) + -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) - ;; 8-reduction.watsup:760.1-761.51 - rule data.drop {x : idx, z : state}: - `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) + ;; 8-reduction.watsup:10.1-12.34 + rule pure {instr* : instr*, instr'* : instr*, z : state}: + `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) + -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) ;; 8-reduction.watsup:8.1-8.63 rec { ;; 8-reduction.watsup:8.1-8.63 relation Steps: `%~>*%`(config, config) - ;; 8-reduction.watsup:18.1-19.36 - rule refl {admininstr* : admininstr*, z : state}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) - ;; 8-reduction.watsup:21.1-24.53 rule trans {admininstr* : admininstr*, admininstr' : admininstr, admininstr''* : admininstr*, z : state, z' : state, z'' : state}: `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z'', admininstr''*{admininstr''})) -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z', admininstr'*{})) -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr''})) + + ;; 8-reduction.watsup:18.1-19.36 + rule refl {admininstr* : admininstr*, z : state}: + `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) } ;; 8-reduction.watsup:29.1-29.69 @@ -12035,14 +12178,14 @@ rec { ;; 9-module.watsup:7.1-7.34 def alloctypes : type* -> deftype* - ;; 9-module.watsup:8.1-8.27 - def alloctypes([]) = [] ;; 9-module.watsup:9.1-13.24 def {deftype* : deftype*, deftype'* : deftype*, rectype : rectype, type : type, type'* : type*, x : idx} alloctypes(type'*{type'} :: [type]) = deftype'*{deftype'} :: deftype*{deftype} -- if (deftype'*{deftype'} = $alloctypes(type'*{type'})) -- if (type = TYPE(rectype)) -- if (deftype*{deftype} = $subst_all_deftypes($rolldt(x, rectype), $heaptype_deftype(deftype')*{deftype'})) -- if (x = |deftype'*{deftype'}|) + ;; 9-module.watsup:8.1-8.27 + def alloctypes([]) = [] } ;; 9-module.watsup:15.1-15.60 @@ -12057,12 +12200,12 @@ rec { ;; 9-module.watsup:20.1-20.63 def allocfuncs : (store, moduleinst, func*) -> (store, funcaddr*) - ;; 9-module.watsup:21.1-21.39 - def {mm : moduleinst, s : store} allocfuncs(s, mm, []) = (s, []) ;; 9-module.watsup:22.1-24.51 def {fa : funcaddr, fa'* : funcaddr*, func : func, func'* : func*, mm : moduleinst, s : store, s_1 : store, s_2 : store} allocfuncs(s, mm, [func] :: func'*{func'}) = (s_2, [fa] :: fa'*{fa'}) -- if ((s_1, fa) = $allocfunc(s, mm, func)) -- if ((s_2, fa'*{fa'}) = $allocfuncs(s_1, mm, func'*{func'})) + ;; 9-module.watsup:21.1-21.39 + def {mm : moduleinst, s : store} allocfuncs(s, mm, []) = (s, []) } ;; 9-module.watsup:26.1-26.63 @@ -12076,12 +12219,12 @@ rec { ;; 9-module.watsup:30.1-30.67 def allocglobals : (store, globaltype*, val*) -> (store, globaladdr*) - ;; 9-module.watsup:31.1-31.42 - def {s : store} allocglobals(s, [], []) = (s, []) ;; 9-module.watsup:32.1-34.62 def {ga : globaladdr, ga'* : globaladdr*, globaltype : globaltype, globaltype'* : globaltype*, s : store, s_1 : store, s_2 : store, val : val, val'* : val*} allocglobals(s, [globaltype] :: globaltype'*{globaltype'}, [val] :: val'*{val'}) = (s_2, [ga] :: ga'*{ga'}) -- if ((s_1, ga) = $allocglobal(s, globaltype, val)) -- if ((s_2, ga'*{ga'}) = $allocglobals(s_1, globaltype'*{globaltype'}, val'*{val'})) + ;; 9-module.watsup:31.1-31.42 + def {s : store} allocglobals(s, [], []) = (s, []) } ;; 9-module.watsup:36.1-36.60 @@ -12095,12 +12238,12 @@ rec { ;; 9-module.watsup:40.1-40.64 def alloctables : (store, tabletype*, ref*) -> (store, tableaddr*) - ;; 9-module.watsup:41.1-41.41 - def {s : store} alloctables(s, [], []) = (s, []) ;; 9-module.watsup:42.1-44.60 def {ref : ref, ref'* : ref*, s : store, s_1 : store, s_2 : store, ta : tableaddr, ta'* : tableaddr*, tabletype : tabletype, tabletype'* : tabletype*} alloctables(s, [tabletype] :: tabletype'*{tabletype'}, [ref] :: ref'*{ref'}) = (s_2, [ta] :: ta'*{ta'}) -- if ((s_1, ta) = $alloctable(s, tabletype, ref)) -- if ((s_2, ta'*{ta'}) = $alloctables(s_1, tabletype'*{tabletype'}, ref'*{ref'})) + ;; 9-module.watsup:41.1-41.41 + def {s : store} alloctables(s, [], []) = (s, []) } ;; 9-module.watsup:46.1-46.49 @@ -12114,12 +12257,12 @@ rec { ;; 9-module.watsup:50.1-50.52 def allocmems : (store, memtype*) -> (store, memaddr*) - ;; 9-module.watsup:51.1-51.34 - def {s : store} allocmems(s, []) = (s, []) ;; 9-module.watsup:52.1-54.49 def {ma : memaddr, ma'* : memaddr*, memtype : memtype, memtype'* : memtype*, s : store, s_1 : store, s_2 : store} allocmems(s, [memtype] :: memtype'*{memtype'}) = (s_2, [ma] :: ma'*{ma'}) -- if ((s_1, ma) = $allocmem(s, memtype)) -- if ((s_2, ma'*{ma'}) = $allocmems(s_1, memtype'*{memtype'})) + ;; 9-module.watsup:51.1-51.34 + def {s : store} allocmems(s, []) = (s, []) } ;; 9-module.watsup:56.1-56.57 @@ -12133,12 +12276,12 @@ rec { ;; 9-module.watsup:60.1-60.63 def allocelems : (store, reftype*, ref**) -> (store, elemaddr*) - ;; 9-module.watsup:61.1-61.40 - def {s : store} allocelems(s, [], []) = (s, []) ;; 9-module.watsup:62.1-64.55 def {ea : elemaddr, ea'* : elemaddr*, ref* : ref*, ref'** : ref**, rt : reftype, rt'* : reftype*, s : store, s_1 : store, s_2 : store} allocelems(s, [rt] :: rt'*{rt'}, [ref*{ref}] :: ref'*{ref'}*{ref'}) = (s_2, [ea] :: ea'*{ea'}) -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref})) -- if ((s_2, ea'*{ea'}) = $allocelems(s_2, rt'*{rt'}, ref'*{ref'}*{ref'})) + ;; 9-module.watsup:61.1-61.40 + def {s : store} allocelems(s, [], []) = (s, []) } ;; 9-module.watsup:66.1-66.49 @@ -12152,24 +12295,24 @@ rec { ;; 9-module.watsup:70.1-70.54 def allocdatas : (store, byte**) -> (store, dataaddr*) - ;; 9-module.watsup:71.1-71.35 - def {s : store} allocdatas(s, []) = (s, []) ;; 9-module.watsup:72.1-74.50 def {byte* : byte*, byte'** : byte**, da : dataaddr, da'* : dataaddr*, s : store, s_1 : store, s_2 : store} allocdatas(s, [byte*{byte}] :: byte'*{byte'}*{byte'}) = (s_2, [da] :: da'*{da'}) -- if ((s_1, da) = $allocdata(s, byte*{byte})) -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) + ;; 9-module.watsup:71.1-71.35 + def {s : store} allocdatas(s, []) = (s, []) } ;; 9-module.watsup:79.1-79.83 def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst - ;; 9-module.watsup:80.1-80.95 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} - ;; 9-module.watsup:81.1-81.99 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} - ;; 9-module.watsup:82.1-82.97 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} ;; 9-module.watsup:83.1-83.93 def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} + ;; 9-module.watsup:82.1-82.97 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} + ;; 9-module.watsup:81.1-81.99 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} + ;; 9-module.watsup:80.1-80.95 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} ;; 9-module.watsup:86.1-86.87 def allocmodule : (store, module, externval*, val*, ref*, ref**) -> (store, moduleinst) @@ -12201,27 +12344,27 @@ rec { ;; 9-module.watsup:134.1-134.38 def concat_instr : instr** -> instr* - ;; 9-module.watsup:135.1-135.29 - def concat_instr([]) = [] ;; 9-module.watsup:136.1-136.74 def {instr* : instr*, instr'** : instr**} concat_instr([instr*{instr}] :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) + ;; 9-module.watsup:135.1-135.29 + def concat_instr([]) = [] } ;; 9-module.watsup:138.1-138.33 def runelem : (elem, idx) -> instr* - ;; 9-module.watsup:139.1-139.52 - def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, PASSIVE_elemmode), y) = [] - ;; 9-module.watsup:140.1-140.62 - def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] ;; 9-module.watsup:141.1-142.77 def {expr* : expr*, instr* : instr*, reftype : reftype, x : idx, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, ACTIVE_elemmode(x, instr*{instr})), y) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, |expr*{expr}|) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] + ;; 9-module.watsup:140.1-140.62 + def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] + ;; 9-module.watsup:139.1-139.52 + def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, PASSIVE_elemmode), y) = [] ;; 9-module.watsup:144.1-144.33 def rundata : (data, idx) -> instr* - ;; 9-module.watsup:145.1-145.44 - def {byte* : byte*, y : idx} rundata(`DATA%*%`(byte*{byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup:146.1-147.78 def {byte* : byte*, instr* : instr*, x : idx, y : idx} rundata(`DATA%*%`(byte*{byte}, ACTIVE_datamode(x, instr*{instr})), y) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, |byte*{byte}|) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] + ;; 9-module.watsup:145.1-145.44 + def {byte* : byte*, y : idx} rundata(`DATA%*%`(byte*{byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup:149.1-149.53 def instantiate : (store, module, externval*) -> config @@ -12258,20 +12401,20 @@ rec { ;; A-binary.watsup:47.1-47.24 def utf8 : name -> byte* - ;; A-binary.watsup:48.1-48.44 - def {b : byte, c : c} utf8([c]) = [b] - -- if ((c < 128) /\ (c = b)) - ;; A-binary.watsup:49.1-49.93 - def {b_1 : byte, b_2 : byte, c : c} utf8([c]) = [b_1 b_2] - -- if (((128 <= c) /\ (c < 2048)) /\ (c = (((2 ^ 6) * (b_1 - 192)) + (b_2 - 128)))) - ;; A-binary.watsup:50.1-50.144 - def {b_1 : byte, b_2 : byte, b_3 : byte, c : c} utf8([c]) = [b_1 b_2 b_3] - -- if ((((2048 <= c) /\ (c < 55296)) \/ ((57344 <= c) /\ (c < 65536))) /\ (c = ((((2 ^ 12) * (b_1 - 224)) + ((2 ^ 6) * (b_2 - 128))) + (b_3 - 128)))) + ;; A-binary.watsup:52.1-52.41 + def {c* : c*} utf8(c*{c}) = $concat_bytes($utf8([c])*{c}) ;; A-binary.watsup:51.1-51.145 def {b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte, c : c} utf8([c]) = [b_1 b_2 b_3 b_4] -- if (((65536 <= c) /\ (c < 69632)) /\ (c = (((((2 ^ 18) * (b_1 - 240)) + ((2 ^ 12) * (b_2 - 128))) + ((2 ^ 6) * (b_3 - 128))) + (b_4 - 128)))) - ;; A-binary.watsup:52.1-52.41 - def {c* : c*} utf8(c*{c}) = $concat_bytes($utf8([c])*{c}) + ;; A-binary.watsup:50.1-50.144 + def {b_1 : byte, b_2 : byte, b_3 : byte, c : c} utf8([c]) = [b_1 b_2 b_3] + -- if ((((2048 <= c) /\ (c < 55296)) \/ ((57344 <= c) /\ (c < 65536))) /\ (c = ((((2 ^ 12) * (b_1 - 224)) + ((2 ^ 6) * (b_2 - 128))) + (b_3 - 128)))) + ;; A-binary.watsup:49.1-49.93 + def {b_1 : byte, b_2 : byte, c : c} utf8([c]) = [b_1 b_2] + -- if (((128 <= c) /\ (c < 2048)) /\ (c = (((2 ^ 6) * (b_1 - 192)) + (b_2 - 128)))) + ;; A-binary.watsup:48.1-48.44 + def {b : byte, c : c} utf8([c]) = [b] + -- if ((c < 128) /\ (c = b)) } ;; A-binary.watsup:210.1-210.27 @@ -12285,10 +12428,10 @@ rec { ;; A-binary.watsup:665.1-665.62 def concat_locals : local** -> local* - ;; A-binary.watsup:666.1-666.30 - def concat_locals([]) = [] ;; A-binary.watsup:667.1-667.68 def {loc* : local*, loc'** : local**} concat_locals([loc*{loc}] :: loc'*{loc'}*{loc'}) = loc*{loc} :: $concat_locals(loc'*{loc'}*{loc'}) + ;; A-binary.watsup:666.1-666.30 + def concat_locals([]) = [] } ;; A-binary.watsup:670.1-670.29 @@ -12319,12 +12462,12 @@ rec { ;; 0-aux.watsup:27.1-27.25 def min : (nat, nat) -> nat - ;; 0-aux.watsup:28.1-28.19 - def {j : nat} min(0, j) = 0 - ;; 0-aux.watsup:29.1-29.19 - def {i : nat} min(i, 0) = 0 ;; 0-aux.watsup:30.1-30.38 def {i : nat, j : nat} min((i + 1), (j + 1)) = $min(i, j) + ;; 0-aux.watsup:29.1-29.19 + def {i : nat} min(i, 0) = 0 + ;; 0-aux.watsup:28.1-28.19 + def {j : nat} min(0, j) = 0 } ;; 0-aux.watsup:32.1-32.21 @@ -12332,10 +12475,10 @@ rec { ;; 0-aux.watsup:32.1-32.21 def sum : nat* -> nat - ;; 0-aux.watsup:33.1-33.18 - def sum([]) = 0 ;; 0-aux.watsup:34.1-34.35 def {n : n, n'* : n*} sum([n] :: n'*{n'}) = (n + $sum(n'*{n'})) + ;; 0-aux.watsup:33.1-33.18 + def sum([]) = 0 } ;; 1-syntax.watsup:5.1-5.85 @@ -12373,17 +12516,17 @@ syntax s33 = sN ;; 1-syntax.watsup:35.1-35.21 def signif : N -> nat - ;; 1-syntax.watsup:36.1-36.21 - def signif(32) = 23 ;; 1-syntax.watsup:37.1-37.21 def signif(64) = 52 + ;; 1-syntax.watsup:36.1-36.21 + def signif(32) = 23 ;; 1-syntax.watsup:39.1-39.20 def expon : N -> nat - ;; 1-syntax.watsup:40.1-40.19 - def expon(32) = 8 ;; 1-syntax.watsup:41.1-41.20 def expon(64) = 11 + ;; 1-syntax.watsup:40.1-40.19 + def expon(32) = 8 ;; 1-syntax.watsup:43.1-43.35 def M : N -> nat @@ -12929,14 +13072,14 @@ rec { ;; 2-syntax-aux.watsup:8.1-8.33 def setminus1 : (idx, idx*) -> idx* - ;; 2-syntax-aux.watsup:13.1-13.27 - def {x : idx} setminus1(x, []) = [x] - ;; 2-syntax-aux.watsup:14.1-14.57 - def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = [] - -- if (x = y_1) ;; 2-syntax-aux.watsup:15.1-15.60 def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = $setminus1(x, y*{y}) -- otherwise + ;; 2-syntax-aux.watsup:14.1-14.57 + def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = [] + -- if (x = y_1) + ;; 2-syntax-aux.watsup:13.1-13.27 + def {x : idx} setminus1(x, []) = [x] } ;; 2-syntax-aux.watsup:7.1-7.49 @@ -12944,30 +13087,30 @@ rec { ;; 2-syntax-aux.watsup:7.1-7.49 def setminus : (idx*, idx*) -> idx* - ;; 2-syntax-aux.watsup:10.1-10.29 - def {y* : idx*} setminus([], y*{y}) = [] ;; 2-syntax-aux.watsup:11.1-11.66 def {x* : idx*, x_1 : idx, y* : idx*} setminus([x_1] :: x*{x}, y*{y}) = $setminus1(x_1, y*{y}) :: $setminus(x*{x}, y*{y}) + ;; 2-syntax-aux.watsup:10.1-10.29 + def {y* : idx*} setminus([], y*{y}) = [] } ;; 2-syntax-aux.watsup:20.1-20.68 def free_dataidx_instr : instr -> dataidx* - ;; 2-syntax-aux.watsup:21.1-21.45 - def {x : idx, y : idx} free_dataidx_instr(MEMORY.INIT_instr(x, y)) = [y] - ;; 2-syntax-aux.watsup:22.1-22.41 - def {x : idx} free_dataidx_instr(DATA.DROP_instr(x)) = [x] ;; 2-syntax-aux.watsup:23.1-23.34 def {in : instr} free_dataidx_instr(in) = [] + ;; 2-syntax-aux.watsup:22.1-22.41 + def {x : idx} free_dataidx_instr(DATA.DROP_instr(x)) = [x] + ;; 2-syntax-aux.watsup:21.1-21.45 + def {x : idx, y : idx} free_dataidx_instr(MEMORY.INIT_instr(x, y)) = [y] ;; 2-syntax-aux.watsup:25.1-25.70 rec { ;; 2-syntax-aux.watsup:25.1-25.70 def free_dataidx_instrs : instr* -> dataidx* - ;; 2-syntax-aux.watsup:26.1-26.36 - def free_dataidx_instrs([]) = [] ;; 2-syntax-aux.watsup:27.1-27.99 def {instr : instr, instr'* : instr*} free_dataidx_instrs([instr] :: instr'*{instr'}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr'}) + ;; 2-syntax-aux.watsup:26.1-26.36 + def free_dataidx_instrs([]) = [] } ;; 2-syntax-aux.watsup:29.1-29.66 @@ -12985,10 +13128,10 @@ rec { ;; 2-syntax-aux.watsup:35.1-35.68 def free_dataidx_funcs : func* -> dataidx* - ;; 2-syntax-aux.watsup:36.1-36.35 - def free_dataidx_funcs([]) = [] ;; 2-syntax-aux.watsup:37.1-37.92 def {func : func, func'* : func*} free_dataidx_funcs([func] :: func'*{func'}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func'}) + ;; 2-syntax-aux.watsup:36.1-36.35 + def free_dataidx_funcs([]) = [] } ;; 2-syntax-aux.watsup:46.1-46.59 @@ -12996,67 +13139,67 @@ rec { ;; 2-syntax-aux.watsup:46.1-46.59 def concat_bytes : byte** -> byte* - ;; 2-syntax-aux.watsup:47.1-47.29 - def concat_bytes([]) = [] ;; 2-syntax-aux.watsup:48.1-48.58 def {b* : byte*, b'** : byte**} concat_bytes([b*{b}] :: b'*{b'}*{b'}) = b*{b} :: $concat_bytes(b'*{b'}*{b'}) + ;; 2-syntax-aux.watsup:47.1-47.29 + def concat_bytes([]) = [] } ;; 2-syntax-aux.watsup:59.1-59.55 def size : valtype -> nat? - ;; 2-syntax-aux.watsup:60.1-60.20 - def size(I32_valtype) = ?(32) - ;; 2-syntax-aux.watsup:61.1-61.20 - def size(I64_valtype) = ?(64) - ;; 2-syntax-aux.watsup:62.1-62.20 - def size(F32_valtype) = ?(32) - ;; 2-syntax-aux.watsup:63.1-63.20 - def size(F64_valtype) = ?(64) ;; 2-syntax-aux.watsup:64.1-64.22 def size(V128_valtype) = ?(128) + ;; 2-syntax-aux.watsup:63.1-63.20 + def size(F64_valtype) = ?(64) + ;; 2-syntax-aux.watsup:62.1-62.20 + def size(F32_valtype) = ?(32) + ;; 2-syntax-aux.watsup:61.1-61.20 + def size(I64_valtype) = ?(64) + ;; 2-syntax-aux.watsup:60.1-60.20 + def size(I32_valtype) = ?(32) def {x : valtype} size(x) = ?() ;; 2-syntax-aux.watsup:66.1-66.50 def packedsize : packedtype -> nat - ;; 2-syntax-aux.watsup:67.1-67.24 - def packedsize(I8_packedtype) = 8 ;; 2-syntax-aux.watsup:68.1-68.26 def packedsize(I16_packedtype) = 16 + ;; 2-syntax-aux.watsup:67.1-67.24 + def packedsize(I8_packedtype) = 8 ;; 2-syntax-aux.watsup:70.1-70.52 def storagesize : storagetype -> nat - ;; 2-syntax-aux.watsup:71.1-71.43 - def {valtype : valtype} storagesize($storagetype_valtype(valtype)) = !($size(valtype)) ;; 2-syntax-aux.watsup:72.1-72.55 def {packedtype : packedtype} storagesize($storagetype_packedtype(packedtype)) = $packedsize(packedtype) + ;; 2-syntax-aux.watsup:71.1-71.43 + def {valtype : valtype} storagesize($storagetype_valtype(valtype)) = !($size(valtype)) ;; 2-syntax-aux.watsup:77.1-77.62 def unpacktype : storagetype -> valtype - ;; 2-syntax-aux.watsup:78.1-78.35 - def {valtype : valtype} unpacktype($storagetype_valtype(valtype)) = valtype ;; 2-syntax-aux.watsup:79.1-79.34 def {packedtype : packedtype} unpacktype($storagetype_packedtype(packedtype)) = I32_valtype + ;; 2-syntax-aux.watsup:78.1-78.35 + def {valtype : valtype} unpacktype($storagetype_valtype(valtype)) = valtype ;; 2-syntax-aux.watsup:81.1-81.65 def unpacknumtype : storagetype -> numtype - ;; 2-syntax-aux.watsup:82.1-82.38 - def {numtype : numtype} unpacknumtype($storagetype_numtype(numtype)) = numtype ;; 2-syntax-aux.watsup:83.1-83.37 def {packedtype : packedtype} unpacknumtype($storagetype_packedtype(packedtype)) = I32_numtype + ;; 2-syntax-aux.watsup:82.1-82.38 + def {numtype : numtype} unpacknumtype($storagetype_numtype(numtype)) = numtype ;; 2-syntax-aux.watsup:85.1-85.51 def sxfield : storagetype -> sx? - ;; 2-syntax-aux.watsup:86.1-86.28 - def {valtype : valtype} sxfield($storagetype_valtype(valtype)) = ?() ;; 2-syntax-aux.watsup:87.1-87.29 def {packedtype : packedtype} sxfield($storagetype_packedtype(packedtype)) = ?(S_sx) + ;; 2-syntax-aux.watsup:86.1-86.28 + def {valtype : valtype} sxfield($storagetype_valtype(valtype)) = ?() ;; 2-syntax-aux.watsup:92.1-92.59 def diffrt : (reftype, reftype) -> reftype - ;; 2-syntax-aux.watsup:94.1-94.64 - def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) = REF_reftype(`NULL%?`(?()), ht_1) ;; 2-syntax-aux.watsup:95.1-95.65 def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?()), ht_2)) = REF_reftype(nul_1, ht_1) + ;; 2-syntax-aux.watsup:94.1-94.64 + def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) = REF_reftype(`NULL%?`(?()), ht_1) ;; 2-syntax-aux.watsup:100.1-100.42 syntax typevar = @@ -13077,14 +13220,14 @@ rec { ;; 2-syntax-aux.watsup:109.1-109.92 def subst_typevar : (typevar, typevar*, heaptype*) -> heaptype - ;; 2-syntax-aux.watsup:134.1-134.38 - def {xx : typevar} subst_typevar(xx, [], []) = $heaptype_typevar(xx) - ;; 2-syntax-aux.watsup:135.1-135.95 - def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 - -- if (xx = xx_1) ;; 2-syntax-aux.watsup:136.1-136.92 def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = $subst_typevar(xx, xx'*{xx'}, ht'*{ht'}) -- otherwise + ;; 2-syntax-aux.watsup:135.1-135.95 + def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 + -- if (xx = xx_1) + ;; 2-syntax-aux.watsup:134.1-134.38 + def {xx : typevar} subst_typevar(xx, [], []) = $heaptype_typevar(xx) } ;; 2-syntax-aux.watsup:111.1-111.92 @@ -13107,13 +13250,13 @@ rec { ;; 2-syntax-aux.watsup:113.1-113.92 def subst_heaptype : (heaptype, typevar*, heaptype*) -> heaptype - ;; 2-syntax-aux.watsup:141.1-141.67 - def {ht* : heaptype*, xx* : typevar*, xx' : typevar} subst_heaptype($heaptype_typevar(xx'), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) - ;; 2-syntax-aux.watsup:142.1-142.65 - def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_heaptype($heaptype_deftype(dt), xx*{xx}, ht*{ht}) = $heaptype_deftype($subst_deftype(dt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:143.1-143.55 def {ht* : heaptype*, ht' : heaptype, xx* : typevar*} subst_heaptype(ht', xx*{xx}, ht*{ht}) = ht' -- otherwise + ;; 2-syntax-aux.watsup:142.1-142.65 + def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_heaptype($heaptype_deftype(dt), xx*{xx}, ht*{ht}) = $heaptype_deftype($subst_deftype(dt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:141.1-141.67 + def {ht* : heaptype*, xx* : typevar*, xx' : typevar} subst_heaptype($heaptype_typevar(xx'), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) ;; 2-syntax-aux.watsup:114.1-114.92 def subst_reftype : (reftype, typevar*, heaptype*) -> reftype @@ -13122,21 +13265,21 @@ def subst_reftype : (reftype, typevar*, heaptype*) -> reftype ;; 2-syntax-aux.watsup:115.1-115.92 def subst_valtype : (valtype, typevar*, heaptype*) -> valtype - ;; 2-syntax-aux.watsup:147.1-147.64 - def {ht* : heaptype*, nt : numtype, xx* : typevar*} subst_valtype($valtype_numtype(nt), xx*{xx}, ht*{ht}) = $valtype_numtype($subst_numtype(nt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:148.1-148.64 - def {ht* : heaptype*, vt : vectype, xx* : typevar*} subst_valtype($valtype_vectype(vt), xx*{xx}, ht*{ht}) = $valtype_vectype($subst_vectype(vt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:149.1-149.64 - def {ht* : heaptype*, rt : reftype, xx* : typevar*} subst_valtype($valtype_reftype(rt), xx*{xx}, ht*{ht}) = $valtype_reftype($subst_reftype(rt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:150.1-150.40 def {ht* : heaptype*, xx* : typevar*} subst_valtype(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + ;; 2-syntax-aux.watsup:149.1-149.64 + def {ht* : heaptype*, rt : reftype, xx* : typevar*} subst_valtype($valtype_reftype(rt), xx*{xx}, ht*{ht}) = $valtype_reftype($subst_reftype(rt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:148.1-148.64 + def {ht* : heaptype*, vt : vectype, xx* : typevar*} subst_valtype($valtype_vectype(vt), xx*{xx}, ht*{ht}) = $valtype_vectype($subst_vectype(vt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:147.1-147.64 + def {ht* : heaptype*, nt : numtype, xx* : typevar*} subst_valtype($valtype_numtype(nt), xx*{xx}, ht*{ht}) = $valtype_numtype($subst_numtype(nt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:118.1-118.92 def subst_storagetype : (storagetype, typevar*, heaptype*) -> storagetype - ;; 2-syntax-aux.watsup:154.1-154.66 - def {ht* : heaptype*, t : valtype, xx* : typevar*} subst_storagetype($storagetype_valtype(t), xx*{xx}, ht*{ht}) = $storagetype_valtype($subst_valtype(t, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:155.1-155.71 def {ht* : heaptype*, pt : packedtype, xx* : typevar*} subst_storagetype($storagetype_packedtype(pt), xx*{xx}, ht*{ht}) = $storagetype_packedtype($subst_packedtype(pt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:154.1-154.66 + def {ht* : heaptype*, t : valtype, xx* : typevar*} subst_storagetype($storagetype_valtype(t), xx*{xx}, ht*{ht}) = $storagetype_valtype($subst_valtype(t, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:119.1-119.92 def subst_fieldtype : (fieldtype, typevar*, heaptype*) -> fieldtype @@ -13145,19 +13288,19 @@ def subst_fieldtype : (fieldtype, typevar*, heaptype*) -> fieldtype ;; 2-syntax-aux.watsup:121.1-121.92 def subst_comptype : (comptype, typevar*, heaptype*) -> comptype - ;; 2-syntax-aux.watsup:159.1-159.85 - def {ht* : heaptype*, xx* : typevar*, yt* : fieldtype*} subst_comptype(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) - ;; 2-syntax-aux.watsup:160.1-160.81 - def {ht* : heaptype*, xx* : typevar*, yt : fieldtype} subst_comptype(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:161.1-161.78 def {ft : functype, ht* : heaptype*, xx* : typevar*} subst_comptype(FUNC_comptype(ft), xx*{xx}, ht*{ht}) = FUNC_comptype($subst_functype(ft, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:160.1-160.81 + def {ht* : heaptype*, xx* : typevar*, yt : fieldtype} subst_comptype(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:159.1-159.85 + def {ht* : heaptype*, xx* : typevar*, yt* : fieldtype*} subst_comptype(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) ;; 2-syntax-aux.watsup:122.1-122.92 def subst_subtype : (subtype, typevar*, heaptype*) -> subtype - ;; 2-syntax-aux.watsup:163.1-164.76 - def {ct : comptype, fin : fin, ht* : heaptype*, xx* : typevar*, y* : idx*} subst_subtype(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:165.1-166.73 def {ct : comptype, fin : fin, ht* : heaptype*, ht'* : heaptype*, xx* : typevar*} subst_subtype(SUBD_subtype(fin, ht'*{ht'}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx}, ht*{ht})*{ht'}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:163.1-164.76 + def {ct : comptype, fin : fin, ht* : heaptype*, xx* : typevar*, y* : idx*} subst_subtype(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:123.1-123.92 def subst_rectype : (rectype, typevar*, heaptype*) -> rectype @@ -13192,14 +13335,14 @@ def subst_memtype : (memtype, typevar*, heaptype*) -> memtype ;; 2-syntax-aux.watsup:131.1-131.92 def subst_externtype : (externtype, typevar*, heaptype*) -> externtype - ;; 2-syntax-aux.watsup:177.1-177.79 - def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_externtype(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:178.1-178.86 - def {gt : globaltype, ht* : heaptype*, xx* : typevar*} subst_externtype(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:179.1-179.83 - def {ht* : heaptype*, tt : tabletype, xx* : typevar*} subst_externtype(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:180.1-180.77 def {ht* : heaptype*, mt : memtype, xx* : typevar*} subst_externtype(MEM_externtype(mt), xx*{xx}, ht*{ht}) = MEM_externtype($subst_memtype(mt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:179.1-179.83 + def {ht* : heaptype*, tt : tabletype, xx* : typevar*} subst_externtype(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:178.1-178.86 + def {gt : globaltype, ht* : heaptype*, xx* : typevar*} subst_externtype(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:177.1-177.79 + def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_externtype(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:183.1-183.74 def subst_all_reftype : (reftype, heaptype*) -> reftype @@ -13216,10 +13359,10 @@ rec { ;; 2-syntax-aux.watsup:189.1-189.77 def subst_all_deftypes : (deftype*, heaptype*) -> deftype* - ;; 2-syntax-aux.watsup:191.1-191.40 - def {ht* : heaptype*} subst_all_deftypes([], ht*{ht}) = [] ;; 2-syntax-aux.watsup:192.1-192.101 def {dt* : deftype*, dt_1 : deftype, ht* : heaptype*} subst_all_deftypes([dt_1] :: dt*{dt}, ht*{ht}) = [$subst_all_deftype(dt_1, ht*{ht})] :: $subst_all_deftypes(dt*{dt}, ht*{ht}) + ;; 2-syntax-aux.watsup:191.1-191.40 + def {ht* : heaptype*} subst_all_deftypes([], ht*{ht}) = [] } ;; 2-syntax-aux.watsup:197.1-197.65 @@ -13263,13 +13406,13 @@ rec { ;; 2-syntax-aux.watsup:221.1-221.64 def funcsxt : externtype* -> deftype* - ;; 2-syntax-aux.watsup:226.1-226.24 - def funcsxt([]) = [] - ;; 2-syntax-aux.watsup:227.1-227.47 - def {dt : deftype, et* : externtype*} funcsxt([FUNC_externtype(dt)] :: et*{et}) = [dt] :: $funcsxt(et*{et}) ;; 2-syntax-aux.watsup:228.1-228.59 def {et* : externtype*, externtype : externtype} funcsxt([externtype] :: et*{et}) = $funcsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:227.1-227.47 + def {dt : deftype, et* : externtype*} funcsxt([FUNC_externtype(dt)] :: et*{et}) = [dt] :: $funcsxt(et*{et}) + ;; 2-syntax-aux.watsup:226.1-226.24 + def funcsxt([]) = [] } ;; 2-syntax-aux.watsup:222.1-222.66 @@ -13277,13 +13420,13 @@ rec { ;; 2-syntax-aux.watsup:222.1-222.66 def globalsxt : externtype* -> globaltype* - ;; 2-syntax-aux.watsup:230.1-230.26 - def globalsxt([]) = [] - ;; 2-syntax-aux.watsup:231.1-231.53 - def {et* : externtype*, gt : globaltype} globalsxt([GLOBAL_externtype(gt)] :: et*{et}) = [gt] :: $globalsxt(et*{et}) ;; 2-syntax-aux.watsup:232.1-232.63 def {et* : externtype*, externtype : externtype} globalsxt([externtype] :: et*{et}) = $globalsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:231.1-231.53 + def {et* : externtype*, gt : globaltype} globalsxt([GLOBAL_externtype(gt)] :: et*{et}) = [gt] :: $globalsxt(et*{et}) + ;; 2-syntax-aux.watsup:230.1-230.26 + def globalsxt([]) = [] } ;; 2-syntax-aux.watsup:223.1-223.65 @@ -13291,13 +13434,13 @@ rec { ;; 2-syntax-aux.watsup:223.1-223.65 def tablesxt : externtype* -> tabletype* - ;; 2-syntax-aux.watsup:234.1-234.25 - def tablesxt([]) = [] - ;; 2-syntax-aux.watsup:235.1-235.50 - def {et* : externtype*, tt : tabletype} tablesxt([TABLE_externtype(tt)] :: et*{et}) = [tt] :: $tablesxt(et*{et}) ;; 2-syntax-aux.watsup:236.1-236.61 def {et* : externtype*, externtype : externtype} tablesxt([externtype] :: et*{et}) = $tablesxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:235.1-235.50 + def {et* : externtype*, tt : tabletype} tablesxt([TABLE_externtype(tt)] :: et*{et}) = [tt] :: $tablesxt(et*{et}) + ;; 2-syntax-aux.watsup:234.1-234.25 + def tablesxt([]) = [] } ;; 2-syntax-aux.watsup:224.1-224.63 @@ -13305,13 +13448,13 @@ rec { ;; 2-syntax-aux.watsup:224.1-224.63 def memsxt : externtype* -> memtype* - ;; 2-syntax-aux.watsup:238.1-238.23 - def memsxt([]) = [] - ;; 2-syntax-aux.watsup:239.1-239.44 - def {et* : externtype*, mt : memtype} memsxt([MEM_externtype(mt)] :: et*{et}) = [mt] :: $memsxt(et*{et}) ;; 2-syntax-aux.watsup:240.1-240.57 def {et* : externtype*, externtype : externtype} memsxt([externtype] :: et*{et}) = $memsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:239.1-239.44 + def {et* : externtype*, mt : memtype} memsxt([MEM_externtype(mt)] :: et*{et}) = [mt] :: $memsxt(et*{et}) + ;; 2-syntax-aux.watsup:238.1-238.23 + def memsxt([]) = [] } ;; 2-syntax-aux.watsup:249.1-249.33 @@ -13324,12 +13467,12 @@ def s33_to_u32 : s33 -> u32 ;; 3-numerics.watsup:12.1-12.57 def signed : (N, nat) -> int - ;; 3-numerics.watsup:13.1-13.54 - def {N : N, i : nat} signed(N, i) = (i <: int) - -- if (0 <= (2 ^ (N - 1))) ;; 3-numerics.watsup:14.1-14.60 def {N : N, i : nat} signed(N, i) = ((i - (2 ^ N)) <: int) -- if (((2 ^ (N - 1)) <= i) /\ (i < (2 ^ N))) + ;; 3-numerics.watsup:13.1-13.54 + def {N : N, i : nat} signed(N, i) = (i <: int) + -- if (0 <= (2 ^ (N - 1))) ;; 3-numerics.watsup:16.1-16.63 def invsigned : (N, int) -> nat @@ -13757,45 +13900,45 @@ def inst_reftype : (moduleinst, reftype) -> reftype ;; 5-runtime-aux.watsup:19.1-19.52 def default : valtype -> val? - ;; 5-runtime-aux.watsup:21.1-21.34 - def default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) - ;; 5-runtime-aux.watsup:22.1-22.34 - def default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) - ;; 5-runtime-aux.watsup:23.1-23.34 - def default(F32_valtype) = ?(CONST_val(F32_numtype, 0)) - ;; 5-runtime-aux.watsup:24.1-24.34 - def default(F64_valtype) = ?(CONST_val(F64_numtype, 0)) - ;; 5-runtime-aux.watsup:25.1-25.42 - def {ht : heaptype} default(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) ;; 5-runtime-aux.watsup:26.1-26.31 def {ht : heaptype} default(REF_valtype(`NULL%?`(?()), ht)) = ?() + ;; 5-runtime-aux.watsup:25.1-25.42 + def {ht : heaptype} default(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) + ;; 5-runtime-aux.watsup:24.1-24.34 + def default(F64_valtype) = ?(CONST_val(F64_numtype, 0)) + ;; 5-runtime-aux.watsup:23.1-23.34 + def default(F32_valtype) = ?(CONST_val(F32_numtype, 0)) + ;; 5-runtime-aux.watsup:22.1-22.34 + def default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) + ;; 5-runtime-aux.watsup:21.1-21.34 + def default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) ;; 5-runtime-aux.watsup:31.1-31.73 def packval : (storagetype, val) -> fieldval - ;; 5-runtime-aux.watsup:34.1-34.27 - def {t : valtype, val : val} packval($storagetype_valtype(t), val) = $fieldval_val(val) ;; 5-runtime-aux.watsup:35.1-35.70 def {i : nat, pt : packedtype} packval($storagetype_packedtype(pt), CONST_val(I32_numtype, i)) = PACK_fieldval(pt, $wrap(32, $packedsize(pt), i)) + ;; 5-runtime-aux.watsup:34.1-34.27 + def {t : valtype, val : val} packval($storagetype_valtype(t), val) = $fieldval_val(val) ;; 5-runtime-aux.watsup:32.1-32.83 def unpackval : (storagetype, sx?, fieldval) -> val - ;; 5-runtime-aux.watsup:37.1-37.34 - def {t : valtype, val : val} unpackval($storagetype_valtype(t), ?(), $fieldval_val(val)) = val ;; 5-runtime-aux.watsup:38.1-38.79 def {i : nat, pt : packedtype, sx : sx} unpackval($storagetype_packedtype(pt), ?(sx), PACK_fieldval(pt, i)) = CONST_val(I32_numtype, $ext($packedsize(pt), 32, sx, i)) + ;; 5-runtime-aux.watsup:37.1-37.34 + def {t : valtype, val : val} unpackval($storagetype_valtype(t), ?(), $fieldval_val(val)) = val ;; 5-runtime-aux.watsup:43.1-43.62 rec { ;; 5-runtime-aux.watsup:43.1-43.62 def funcsxv : externval* -> funcaddr* - ;; 5-runtime-aux.watsup:48.1-48.24 - def funcsxv([]) = [] - ;; 5-runtime-aux.watsup:49.1-49.47 - def {fa : funcaddr, xv* : externval*} funcsxv([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) ;; 5-runtime-aux.watsup:50.1-50.58 def {externval : externval, xv* : externval*} funcsxv([externval] :: xv*{xv}) = $funcsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:49.1-49.47 + def {fa : funcaddr, xv* : externval*} funcsxv([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:48.1-48.24 + def funcsxv([]) = [] } ;; 5-runtime-aux.watsup:44.1-44.64 @@ -13803,13 +13946,13 @@ rec { ;; 5-runtime-aux.watsup:44.1-44.64 def globalsxv : externval* -> globaladdr* - ;; 5-runtime-aux.watsup:52.1-52.26 - def globalsxv([]) = [] - ;; 5-runtime-aux.watsup:53.1-53.53 - def {ga : globaladdr, xv* : externval*} globalsxv([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) ;; 5-runtime-aux.watsup:54.1-54.62 def {externval : externval, xv* : externval*} globalsxv([externval] :: xv*{xv}) = $globalsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:53.1-53.53 + def {ga : globaladdr, xv* : externval*} globalsxv([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:52.1-52.26 + def globalsxv([]) = [] } ;; 5-runtime-aux.watsup:45.1-45.63 @@ -13817,13 +13960,13 @@ rec { ;; 5-runtime-aux.watsup:45.1-45.63 def tablesxv : externval* -> tableaddr* - ;; 5-runtime-aux.watsup:56.1-56.25 - def tablesxv([]) = [] - ;; 5-runtime-aux.watsup:57.1-57.50 - def {ta : tableaddr, xv* : externval*} tablesxv([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) ;; 5-runtime-aux.watsup:58.1-58.60 def {externval : externval, xv* : externval*} tablesxv([externval] :: xv*{xv}) = $tablesxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:57.1-57.50 + def {ta : tableaddr, xv* : externval*} tablesxv([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) + ;; 5-runtime-aux.watsup:56.1-56.25 + def tablesxv([]) = [] } ;; 5-runtime-aux.watsup:46.1-46.61 @@ -13831,13 +13974,13 @@ rec { ;; 5-runtime-aux.watsup:46.1-46.61 def memsxv : externval* -> memaddr* - ;; 5-runtime-aux.watsup:60.1-60.23 - def memsxv([]) = [] - ;; 5-runtime-aux.watsup:61.1-61.44 - def {ma : memaddr, xv* : externval*} memsxv([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) ;; 5-runtime-aux.watsup:62.1-62.56 def {externval : externval, xv* : externval*} memsxv([externval] :: xv*{xv}) = $memsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:61.1-61.44 + def {ma : memaddr, xv* : externval*} memsxv([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:60.1-60.23 + def memsxv([]) = [] } ;; 5-runtime-aux.watsup:72.1-72.57 @@ -14039,10 +14182,10 @@ rec { ;; 6-typing.watsup:26.1-26.86 def with_locals : (context, localidx*, localtype*) -> context - ;; 6-typing.watsup:28.1-28.34 - def {C : context} with_locals(C, [], []) = C ;; 6-typing.watsup:29.1-29.85 def {C : context, lt* : localtype*, lt_1 : localtype, x* : idx*, x_1 : idx} with_locals(C, [x_1] :: x*{x}, [lt_1] :: lt*{lt}) = $with_locals(C[LOCAL_context[x_1] = lt_1], x*{x}, lt*{lt}) + ;; 6-typing.watsup:28.1-28.34 + def {C : context} with_locals(C, [], []) = C } ;; 6-typing.watsup:33.1-33.65 @@ -14050,11 +14193,11 @@ rec { ;; 6-typing.watsup:33.1-33.65 def clostypes : deftype* -> deftype* - ;; 6-typing.watsup:37.1-37.26 - def clostypes([]) = [] ;; 6-typing.watsup:38.1-38.93 def {dt* : deftype*, dt'* : deftype*, dt_N : deftype} clostypes(dt*{dt} :: [dt_N]) = dt'*{dt'} :: [$subst_all_deftype(dt_N, $heaptype_deftype(dt')*{dt'})] -- if (dt'*{dt'} = $clostypes(dt*{dt})) + ;; 6-typing.watsup:37.1-37.26 + def clostypes([]) = [] } ;; 6-typing.watsup:32.1-32.65 @@ -14077,19 +14220,19 @@ relation Vectype_ok: `%|-%:OK`(context, vectype) ;; 6-typing.watsup:49.1-49.72 relation Heaptype_ok: `%|-%:OK`(context, heaptype) - ;; 6-typing.watsup:60.1-61.24 - rule abs {C : context, absheaptype : absheaptype}: - `%|-%:OK`(C, $heaptype_absheaptype(absheaptype)) + ;; 6-typing.watsup:67.1-69.22 + rule rec {C : context, i : nat, st : subtype}: + `%|-%:OK`(C, REC_heaptype(i)) + -- if (C.REC_context[i] = st) ;; 6-typing.watsup:63.1-65.23 rule typeidx {C : context, dt : deftype, x : idx}: `%|-%:OK`(C, _IDX_heaptype(x)) -- if (C.TYPE_context[x] = dt) - ;; 6-typing.watsup:67.1-69.22 - rule rec {C : context, i : nat, st : subtype}: - `%|-%:OK`(C, REC_heaptype(i)) - -- if (C.REC_context[i] = st) + ;; 6-typing.watsup:60.1-61.24 + rule abs {C : context, absheaptype : absheaptype}: + `%|-%:OK`(C, $heaptype_absheaptype(absheaptype)) ;; 6-typing.watsup:50.1-50.71 relation Reftype_ok: `%|-%:OK`(context, reftype) @@ -14100,24 +14243,24 @@ relation Reftype_ok: `%|-%:OK`(context, reftype) ;; 6-typing.watsup:51.1-51.71 relation Valtype_ok: `%|-%:OK`(context, valtype) - ;; 6-typing.watsup:75.1-77.35 - rule num {C : context, numtype : numtype}: - `%|-%:OK`(C, $valtype_numtype(numtype)) - -- Numtype_ok: `%|-%:OK`(C, numtype) - - ;; 6-typing.watsup:79.1-81.35 - rule vec {C : context, vectype : vectype}: - `%|-%:OK`(C, $valtype_vectype(vectype)) - -- Vectype_ok: `%|-%:OK`(C, vectype) + ;; 6-typing.watsup:87.1-88.16 + rule bot {C : context}: + `%|-%:OK`(C, BOT_valtype) ;; 6-typing.watsup:83.1-85.35 rule ref {C : context, reftype : reftype}: `%|-%:OK`(C, $valtype_reftype(reftype)) -- Reftype_ok: `%|-%:OK`(C, reftype) - ;; 6-typing.watsup:87.1-88.16 - rule bot {C : context}: - `%|-%:OK`(C, BOT_valtype) + ;; 6-typing.watsup:79.1-81.35 + rule vec {C : context, vectype : vectype}: + `%|-%:OK`(C, $valtype_vectype(vectype)) + -- Vectype_ok: `%|-%:OK`(C, vectype) + + ;; 6-typing.watsup:75.1-77.35 + rule num {C : context, numtype : numtype}: + `%|-%:OK`(C, $valtype_numtype(numtype)) + -- Numtype_ok: `%|-%:OK`(C, numtype) ;; 6-typing.watsup:93.1-93.74 relation Resulttype_ok: `%|-%:OK`(context, resulttype) @@ -14151,16 +14294,16 @@ relation Packedtype_ok: `%|-%:OK`(context, packedtype) ;; 6-typing.watsup:114.1-114.77 relation Storagetype_ok: `%|-%:OK`(context, storagetype) - ;; 6-typing.watsup:131.1-133.35 - rule val {C : context, valtype : valtype}: - `%|-%:OK`(C, $storagetype_valtype(valtype)) - -- Valtype_ok: `%|-%:OK`(C, valtype) - ;; 6-typing.watsup:135.1-137.41 rule packed {C : context, packedtype : packedtype}: `%|-%:OK`(C, $storagetype_packedtype(packedtype)) -- Packedtype_ok: `%|-%:OK`(C, packedtype) + ;; 6-typing.watsup:131.1-133.35 + rule val {C : context, valtype : valtype}: + `%|-%:OK`(C, $storagetype_valtype(valtype)) + -- Valtype_ok: `%|-%:OK`(C, valtype) + ;; 6-typing.watsup:113.1-113.75 relation Fieldtype_ok: `%|-%:OK`(context, fieldtype) ;; 6-typing.watsup:139.1-141.34 @@ -14178,20 +14321,20 @@ relation Functype_ok: `%|-%:OK`(context, functype) ;; 6-typing.watsup:115.1-115.74 relation Comptype_ok: `%|-%:OK`(context, comptype) - ;; 6-typing.watsup:144.1-146.35 - rule struct {C : context, yt* : fieldtype*}: - `%|-%:OK`(C, STRUCT_comptype(yt*{yt})) - -- (Fieldtype_ok: `%|-%:OK`(C, yt))*{yt} + ;; 6-typing.watsup:152.1-154.31 + rule func {C : context, ft : functype}: + `%|-%:OK`(C, FUNC_comptype(ft)) + -- Functype_ok: `%|-%:OK`(C, ft) ;; 6-typing.watsup:148.1-150.32 rule array {C : context, yt : fieldtype}: `%|-%:OK`(C, ARRAY_comptype(yt)) -- Fieldtype_ok: `%|-%:OK`(C, yt) - ;; 6-typing.watsup:152.1-154.31 - rule func {C : context, ft : functype}: - `%|-%:OK`(C, FUNC_comptype(ft)) - -- Functype_ok: `%|-%:OK`(C, ft) + ;; 6-typing.watsup:144.1-146.35 + rule struct {C : context, yt* : fieldtype*}: + `%|-%:OK`(C, STRUCT_comptype(yt*{yt})) + -- (Fieldtype_ok: `%|-%:OK`(C, yt))*{yt} ;; 6-typing.watsup:391.1-391.91 relation Packedtype_sub: `%|-%<:%`(context, packedtype, packedtype) @@ -14210,113 +14353,113 @@ rec { ;; 6-typing.watsup:125.1-125.75 relation Deftype_sub: `%|-%<:%`(context, deftype, deftype) - ;; 6-typing.watsup:434.1-436.58 - rule refl {C : context, deftype_1 : deftype, deftype_2 : deftype}: - `%|-%<:%`(C, deftype_1, deftype_2) - -- if ($clostype(C, deftype_1) = $clostype(C, deftype_2)) - ;; 6-typing.watsup:438.1-441.40 rule super {C : context, ct : comptype, deftype_1 : deftype, deftype_2 : deftype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*}: `%|-%<:%`(C, deftype_1, deftype_2) -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) -- Heaptype_sub: `%|-%<:%`(C, ht, $heaptype_deftype(deftype_2)) + ;; 6-typing.watsup:434.1-436.58 + rule refl {C : context, deftype_1 : deftype, deftype_2 : deftype}: + `%|-%<:%`(C, deftype_1, deftype_2) + -- if ($clostype(C, deftype_1) = $clostype(C, deftype_2)) + ;; 6-typing.watsup:271.1-271.79 relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) - ;; 6-typing.watsup:282.1-283.28 - rule refl {C : context, heaptype : heaptype}: - `%|-%<:%`(C, heaptype, heaptype) + ;; 6-typing.watsup:343.1-344.23 + rule bot {C : context, heaptype : heaptype}: + `%|-%<:%`(C, BOT_heaptype, heaptype) - ;; 6-typing.watsup:285.1-289.48 - rule trans {C : context, heaptype' : heaptype, heaptype_1 : heaptype, heaptype_2 : heaptype}: - `%|-%<:%`(C, heaptype_1, heaptype_2) - -- Heaptype_ok: `%|-%:OK`(C, heaptype') - -- Heaptype_sub: `%|-%<:%`(C, heaptype_1, heaptype') - -- Heaptype_sub: `%|-%<:%`(C, heaptype', heaptype_2) + ;; 6-typing.watsup:339.1-341.43 + rule noextern {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NOEXTERN_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, EXTERN_heaptype) - ;; 6-typing.watsup:291.1-292.17 - rule eq-any {C : context}: - `%|-%<:%`(C, EQ_heaptype, ANY_heaptype) + ;; 6-typing.watsup:335.1-337.41 + rule nofunc {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NOFUNC_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, FUNC_heaptype) - ;; 6-typing.watsup:294.1-295.17 - rule i31-eq {C : context}: - `%|-%<:%`(C, I31_heaptype, EQ_heaptype) + ;; 6-typing.watsup:331.1-333.40 + rule none {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NONE_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, ANY_heaptype) - ;; 6-typing.watsup:297.1-298.20 - rule struct-eq {C : context}: - `%|-%<:%`(C, STRUCT_heaptype, EQ_heaptype) + ;; 6-typing.watsup:327.1-329.48 + rule rec {C : context, ct : comptype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*, i : nat}: + `%|-%<:%`(C, REC_heaptype(i), ht) + -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) - ;; 6-typing.watsup:300.1-301.19 - rule array-eq {C : context}: - `%|-%<:%`(C, ARRAY_heaptype, EQ_heaptype) + ;; 6-typing.watsup:323.1-325.52 + rule typeidx-r {C : context, heaptype : heaptype, typeidx : typeidx}: + `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, $heaptype_deftype(C.TYPE_context[typeidx])) - ;; 6-typing.watsup:303.1-305.35 - rule struct {C : context, deftype : deftype, yt* : fieldtype*}: - `%|-%<:%`(C, $heaptype_deftype(deftype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) + ;; 6-typing.watsup:319.1-321.52 + rule typeidx-l {C : context, heaptype : heaptype, typeidx : typeidx}: + `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) + -- Heaptype_sub: `%|-%<:%`(C, $heaptype_deftype(C.TYPE_context[typeidx]), heaptype) - ;; 6-typing.watsup:307.1-309.33 - rule array {C : context, deftype : deftype, yt : fieldtype}: - `%|-%<:%`(C, $heaptype_deftype(deftype), ARRAY_heaptype) - -- Expand: `%~~%`(deftype, ARRAY_comptype(yt)) + ;; 6-typing.watsup:315.1-317.46 + rule def {C : context, deftype_1 : deftype, deftype_2 : deftype}: + `%|-%<:%`(C, $heaptype_deftype(deftype_1), $heaptype_deftype(deftype_2)) + -- Deftype_sub: `%|-%<:%`(C, deftype_1, deftype_2) ;; 6-typing.watsup:311.1-313.32 rule func {C : context, deftype : deftype, ft : functype}: `%|-%<:%`(C, $heaptype_deftype(deftype), FUNC_heaptype) -- Expand: `%~~%`(deftype, FUNC_comptype(ft)) - ;; 6-typing.watsup:315.1-317.46 - rule def {C : context, deftype_1 : deftype, deftype_2 : deftype}: - `%|-%<:%`(C, $heaptype_deftype(deftype_1), $heaptype_deftype(deftype_2)) - -- Deftype_sub: `%|-%<:%`(C, deftype_1, deftype_2) + ;; 6-typing.watsup:307.1-309.33 + rule array {C : context, deftype : deftype, yt : fieldtype}: + `%|-%<:%`(C, $heaptype_deftype(deftype), ARRAY_heaptype) + -- Expand: `%~~%`(deftype, ARRAY_comptype(yt)) - ;; 6-typing.watsup:319.1-321.52 - rule typeidx-l {C : context, heaptype : heaptype, typeidx : typeidx}: - `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) - -- Heaptype_sub: `%|-%<:%`(C, $heaptype_deftype(C.TYPE_context[typeidx]), heaptype) + ;; 6-typing.watsup:303.1-305.35 + rule struct {C : context, deftype : deftype, yt* : fieldtype*}: + `%|-%<:%`(C, $heaptype_deftype(deftype), STRUCT_heaptype) + -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) - ;; 6-typing.watsup:323.1-325.52 - rule typeidx-r {C : context, heaptype : heaptype, typeidx : typeidx}: - `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, $heaptype_deftype(C.TYPE_context[typeidx])) + ;; 6-typing.watsup:300.1-301.19 + rule array-eq {C : context}: + `%|-%<:%`(C, ARRAY_heaptype, EQ_heaptype) - ;; 6-typing.watsup:327.1-329.48 - rule rec {C : context, ct : comptype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*, i : nat}: - `%|-%<:%`(C, REC_heaptype(i), ht) - -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + ;; 6-typing.watsup:297.1-298.20 + rule struct-eq {C : context}: + `%|-%<:%`(C, STRUCT_heaptype, EQ_heaptype) - ;; 6-typing.watsup:331.1-333.40 - rule none {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NONE_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, ANY_heaptype) + ;; 6-typing.watsup:294.1-295.17 + rule i31-eq {C : context}: + `%|-%<:%`(C, I31_heaptype, EQ_heaptype) - ;; 6-typing.watsup:335.1-337.41 - rule nofunc {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NOFUNC_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, FUNC_heaptype) + ;; 6-typing.watsup:291.1-292.17 + rule eq-any {C : context}: + `%|-%<:%`(C, EQ_heaptype, ANY_heaptype) - ;; 6-typing.watsup:339.1-341.43 - rule noextern {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NOEXTERN_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, EXTERN_heaptype) + ;; 6-typing.watsup:285.1-289.48 + rule trans {C : context, heaptype' : heaptype, heaptype_1 : heaptype, heaptype_2 : heaptype}: + `%|-%<:%`(C, heaptype_1, heaptype_2) + -- Heaptype_ok: `%|-%:OK`(C, heaptype') + -- Heaptype_sub: `%|-%<:%`(C, heaptype_1, heaptype') + -- Heaptype_sub: `%|-%<:%`(C, heaptype', heaptype_2) - ;; 6-typing.watsup:343.1-344.23 - rule bot {C : context, heaptype : heaptype}: - `%|-%<:%`(C, BOT_heaptype, heaptype) + ;; 6-typing.watsup:282.1-283.28 + rule refl {C : context, heaptype : heaptype}: + `%|-%<:%`(C, heaptype, heaptype) } ;; 6-typing.watsup:272.1-272.78 relation Reftype_sub: `%|-%<:%`(context, reftype, reftype) - ;; 6-typing.watsup:347.1-349.37 - rule nonnull {C : context, ht_1 : heaptype, ht_2 : heaptype}: - `%|-%<:%`(C, REF_reftype(`NULL%?`(?()), ht_1), REF_reftype(`NULL%?`(?()), ht_2)) - -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) - ;; 6-typing.watsup:351.1-353.37 rule null {C : context, ht_1 : heaptype, ht_2 : heaptype}: `%|-%<:%`(C, REF_reftype(`NULL%?`(()?{}), ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) + ;; 6-typing.watsup:347.1-349.37 + rule nonnull {C : context, ht_1 : heaptype, ht_2 : heaptype}: + `%|-%<:%`(C, REF_reftype(`NULL%?`(?()), ht_1), REF_reftype(`NULL%?`(?()), ht_2)) + -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) + ;; 6-typing.watsup:270.1-270.78 relation Vectype_sub: `%|-%<:%`(context, vectype, vectype) ;; 6-typing.watsup:278.1-279.26 @@ -14325,50 +14468,50 @@ relation Vectype_sub: `%|-%<:%`(context, vectype, vectype) ;; 6-typing.watsup:273.1-273.78 relation Valtype_sub: `%|-%<:%`(context, valtype, valtype) - ;; 6-typing.watsup:356.1-358.46 - rule num {C : context, numtype_1 : numtype, numtype_2 : numtype}: - `%|-%<:%`(C, $valtype_numtype(numtype_1), $valtype_numtype(numtype_2)) - -- Numtype_sub: `%|-%<:%`(C, numtype_1, numtype_2) - - ;; 6-typing.watsup:360.1-362.46 - rule vec {C : context, vectype_1 : vectype, vectype_2 : vectype}: - `%|-%<:%`(C, $valtype_vectype(vectype_1), $valtype_vectype(vectype_2)) - -- Vectype_sub: `%|-%<:%`(C, vectype_1, vectype_2) + ;; 6-typing.watsup:368.1-369.22 + rule bot {C : context, valtype : valtype}: + `%|-%<:%`(C, BOT_valtype, valtype) ;; 6-typing.watsup:364.1-366.46 rule ref {C : context, reftype_1 : reftype, reftype_2 : reftype}: `%|-%<:%`(C, $valtype_reftype(reftype_1), $valtype_reftype(reftype_2)) -- Reftype_sub: `%|-%<:%`(C, reftype_1, reftype_2) - ;; 6-typing.watsup:368.1-369.22 - rule bot {C : context, valtype : valtype}: - `%|-%<:%`(C, BOT_valtype, valtype) + ;; 6-typing.watsup:360.1-362.46 + rule vec {C : context, vectype_1 : vectype, vectype_2 : vectype}: + `%|-%<:%`(C, $valtype_vectype(vectype_1), $valtype_vectype(vectype_2)) + -- Vectype_sub: `%|-%<:%`(C, vectype_1, vectype_2) + + ;; 6-typing.watsup:356.1-358.46 + rule num {C : context, numtype_1 : numtype, numtype_2 : numtype}: + `%|-%<:%`(C, $valtype_numtype(numtype_1), $valtype_numtype(numtype_2)) + -- Numtype_sub: `%|-%<:%`(C, numtype_1, numtype_2) ;; 6-typing.watsup:392.1-392.92 relation Storagetype_sub: `%|-%<:%`(context, storagetype, storagetype) - ;; 6-typing.watsup:402.1-404.46 - rule val {C : context, valtype_1 : valtype, valtype_2 : valtype}: - `%|-%<:%`(C, $storagetype_valtype(valtype_1), $storagetype_valtype(valtype_2)) - -- Valtype_sub: `%|-%<:%`(C, valtype_1, valtype_2) - ;; 6-typing.watsup:406.1-408.55 rule packed {C : context, packedtype_1 : packedtype, packedtype_2 : packedtype}: `%|-%<:%`(C, $storagetype_packedtype(packedtype_1), $storagetype_packedtype(packedtype_2)) -- Packedtype_sub: `%|-%<:%`(C, packedtype_1, packedtype_2) + ;; 6-typing.watsup:402.1-404.46 + rule val {C : context, valtype_1 : valtype, valtype_2 : valtype}: + `%|-%<:%`(C, $storagetype_valtype(valtype_1), $storagetype_valtype(valtype_2)) + -- Valtype_sub: `%|-%<:%`(C, valtype_1, valtype_2) + ;; 6-typing.watsup:393.1-393.90 relation Fieldtype_sub: `%|-%<:%`(context, fieldtype, fieldtype) - ;; 6-typing.watsup:411.1-413.40 - rule const {C : context, zt_1 : storagetype, zt_2 : storagetype}: - `%|-%<:%`(C, `%%`(`MUT%?`(?()), zt_1), `%%`(`MUT%?`(?()), zt_2)) - -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) - ;; 6-typing.watsup:415.1-418.40 rule var {C : context, zt_1 : storagetype, zt_2 : storagetype}: `%|-%<:%`(C, `%%`(`MUT%?`(?(())), zt_1), `%%`(`MUT%?`(?(())), zt_2)) -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) + ;; 6-typing.watsup:411.1-413.40 + rule const {C : context, zt_1 : storagetype, zt_2 : storagetype}: + `%|-%<:%`(C, `%%`(`MUT%?`(?()), zt_1), `%%`(`MUT%?`(?()), zt_2)) + -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) + ;; 6-typing.watsup:395.1-395.89 relation Functype_sub: `%|-%<:%`(context, functype, functype) ;; 6-typing.watsup:458.1-459.16 @@ -14377,20 +14520,20 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) ;; 6-typing.watsup:124.1-124.76 relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) - ;; 6-typing.watsup:421.1-423.41 - rule struct {C : context, yt'_1 : fieldtype, yt_1* : fieldtype*, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) - -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} + ;; 6-typing.watsup:429.1-431.37 + rule func {C : context, ft_1 : functype, ft_2 : functype}: + `%|-%<:%`(C, FUNC_comptype(ft_1), FUNC_comptype(ft_2)) + -- Functype_sub: `%|-%<:%`(C, ft_1, ft_2) ;; 6-typing.watsup:425.1-427.38 rule array {C : context, yt_1 : fieldtype, yt_2 : fieldtype}: `%|-%<:%`(C, ARRAY_comptype(yt_1), ARRAY_comptype(yt_2)) -- Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2) - ;; 6-typing.watsup:429.1-431.37 - rule func {C : context, ft_1 : functype, ft_2 : functype}: - `%|-%<:%`(C, FUNC_comptype(ft_1), FUNC_comptype(ft_2)) - -- Functype_sub: `%|-%<:%`(C, ft_1, ft_2) + ;; 6-typing.watsup:421.1-423.41 + rule struct {C : context, yt'_1 : fieldtype, yt_1* : fieldtype*, yt_2* : fieldtype*}: + `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) + -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} ;; 6-typing.watsup:117.1-117.73 relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) @@ -14405,21 +14548,21 @@ relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) ;; 6-typing.watsup:165.1-165.65 def before : (heaptype, typeidx, nat) -> bool - ;; 6-typing.watsup:166.1-166.34 - def {deftype : deftype, i : nat, x : idx} before($heaptype_deftype(deftype), x, i) = true - ;; 6-typing.watsup:167.1-167.46 - def {i : nat, typeidx : typeidx, x : idx} before(_IDX_heaptype(typeidx), x, i) = (typeidx < x) ;; 6-typing.watsup:168.1-168.33 def {i : nat, j : nat, x : idx} before(REC_heaptype(j), x, i) = (j < i) + ;; 6-typing.watsup:167.1-167.46 + def {i : nat, typeidx : typeidx, x : idx} before(_IDX_heaptype(typeidx), x, i) = (typeidx < x) + ;; 6-typing.watsup:166.1-166.34 + def {deftype : deftype, i : nat, x : idx} before($heaptype_deftype(deftype), x, i) = true ;; 6-typing.watsup:170.1-170.69 def unrollht : (context, heaptype) -> subtype - ;; 6-typing.watsup:171.1-171.47 - def {C : context, deftype : deftype} unrollht(C, $heaptype_deftype(deftype)) = $unrolldt(deftype) - ;; 6-typing.watsup:172.1-172.60 - def {C : context, typeidx : typeidx} unrollht(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx]) ;; 6-typing.watsup:173.1-173.35 def {C : context, i : nat} unrollht(C, REC_heaptype(i)) = C.REC_context[i] + ;; 6-typing.watsup:172.1-172.60 + def {C : context, typeidx : typeidx} unrollht(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx]) + ;; 6-typing.watsup:171.1-171.47 + def {C : context, deftype : deftype} unrollht(C, $heaptype_deftype(deftype)) = $unrolldt(deftype) ;; 6-typing.watsup:119.1-119.76 relation Subtype_ok2: `%|-%:%`(context, subtype, oktypeidxnat) @@ -14437,15 +14580,15 @@ rec { ;; 6-typing.watsup:120.1-120.76 relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) - ;; 6-typing.watsup:196.1-197.24 - rule empty {C : context, i : nat, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) - ;; 6-typing.watsup:199.1-202.50 rule cons {C : context, i : nat, st* : subtype*, st_1 : subtype, x : idx}: `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidxnat((x + 1), (i + 1))) + + ;; 6-typing.watsup:196.1-197.24 + rule empty {C : context, i : nat, x : idx}: + `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) } ;; 6-typing.watsup:118.1-118.74 @@ -14453,9 +14596,10 @@ rec { ;; 6-typing.watsup:118.1-118.74 relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) - ;; 6-typing.watsup:184.1-185.23 - rule empty {C : context, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) + ;; 6-typing.watsup:192.1-194.49 + rule rec2 {C : context, st* : subtype*, x : idx}: + `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) ;; 6-typing.watsup:187.1-190.43 rule cons {C : context, st* : subtype*, st_1 : subtype, x : idx}: @@ -14463,10 +14607,9 @@ relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x + 1)) - ;; 6-typing.watsup:192.1-194.49 - rule rec2 {C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) + ;; 6-typing.watsup:184.1-185.23 + rule empty {C : context, x : idx}: + `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) } ;; 6-typing.watsup:121.1-121.73 @@ -14509,26 +14652,26 @@ relation Memtype_ok: `%|-%:OK`(context, memtype) ;; 6-typing.watsup:218.1-218.74 relation Externtype_ok: `%|-%:OK`(context, externtype) - ;; 6-typing.watsup:244.1-247.27 - rule func {C : context, dt : deftype, ft : functype}: - `%|-%:OK`(C, FUNC_externtype(dt)) - -- Deftype_ok: `%|-%:OK`(C, dt) - -- Expand: `%~~%`(dt, FUNC_comptype(ft)) - - ;; 6-typing.watsup:249.1-251.33 - rule global {C : context, gt : globaltype}: - `%|-%:OK`(C, GLOBAL_externtype(gt)) - -- Globaltype_ok: `%|-%:OK`(C, gt) + ;; 6-typing.watsup:257.1-259.30 + rule mem {C : context, mt : memtype}: + `%|-%:OK`(C, MEM_externtype(mt)) + -- Memtype_ok: `%|-%:OK`(C, mt) ;; 6-typing.watsup:253.1-255.32 rule table {C : context, tt : tabletype}: `%|-%:OK`(C, TABLE_externtype(tt)) -- Tabletype_ok: `%|-%:OK`(C, tt) - ;; 6-typing.watsup:257.1-259.30 - rule mem {C : context, mt : memtype}: - `%|-%:OK`(C, MEM_externtype(mt)) - -- Memtype_ok: `%|-%:OK`(C, mt) + ;; 6-typing.watsup:249.1-251.33 + rule global {C : context, gt : globaltype}: + `%|-%:OK`(C, GLOBAL_externtype(gt)) + -- Globaltype_ok: `%|-%:OK`(C, gt) + + ;; 6-typing.watsup:244.1-247.27 + rule func {C : context, dt : deftype, ft : functype}: + `%|-%:OK`(C, FUNC_externtype(dt)) + -- Deftype_ok: `%|-%:OK`(C, dt) + -- Expand: `%~~%`(dt, FUNC_comptype(ft)) ;; 6-typing.watsup:374.1-374.81 relation Resulttype_sub: `%|-%*<:%*`(context, valtype*, valtype*) @@ -14557,17 +14700,17 @@ relation Limits_sub: `%|-%<:%`(context, limits, limits) ;; 6-typing.watsup:447.1-447.83 relation Globaltype_sub: `%|-%<:%`(context, globaltype, globaltype) - ;; 6-typing.watsup:461.1-463.34 - rule const {C : context, t_1 : valtype, t_2 : valtype}: - `%|-%<:%`(C, `%%`(`MUT%?`(?()), t_1), `%%`(`MUT%?`(?()), t_2)) - -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) - ;; 6-typing.watsup:465.1-468.34 rule var {C : context, t_1 : valtype, t_2 : valtype}: `%|-%<:%`(C, `%%`(`MUT%?`(?(())), t_1), `%%`(`MUT%?`(?(())), t_2)) -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) -- Valtype_sub: `%|-%<:%`(C, t_2, t_1) + ;; 6-typing.watsup:461.1-463.34 + rule const {C : context, t_1 : valtype, t_2 : valtype}: + `%|-%<:%`(C, `%%`(`MUT%?`(?()), t_1), `%%`(`MUT%?`(?()), t_2)) + -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) + ;; 6-typing.watsup:448.1-448.82 relation Tabletype_sub: `%|-%<:%`(context, tabletype, tabletype) ;; 6-typing.watsup:470.1-474.36 @@ -14586,280 +14729,240 @@ relation Memtype_sub: `%|-%<:%`(context, memtype, memtype) ;; 6-typing.watsup:450.1-450.83 relation Externtype_sub: `%|-%<:%`(context, externtype, externtype) - ;; 6-typing.watsup:481.1-483.36 - rule func {C : context, dt_1 : deftype, dt_2 : deftype}: - `%|-%<:%`(C, FUNC_externtype(dt_1), FUNC_externtype(dt_2)) - -- Deftype_sub: `%|-%<:%`(C, dt_1, dt_2) - - ;; 6-typing.watsup:485.1-487.39 - rule global {C : context, gt_1 : globaltype, gt_2 : globaltype}: - `%|-%<:%`(C, GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) - -- Globaltype_sub: `%|-%<:%`(C, gt_1, gt_2) + ;; 6-typing.watsup:493.1-495.36 + rule mem {C : context, mt_1 : memtype, mt_2 : memtype}: + `%|-%<:%`(C, MEM_externtype(mt_1), MEM_externtype(mt_2)) + -- Memtype_sub: `%|-%<:%`(C, mt_1, mt_2) ;; 6-typing.watsup:489.1-491.38 rule table {C : context, tt_1 : tabletype, tt_2 : tabletype}: `%|-%<:%`(C, TABLE_externtype(tt_1), TABLE_externtype(tt_2)) -- Tabletype_sub: `%|-%<:%`(C, tt_1, tt_2) - ;; 6-typing.watsup:493.1-495.36 - rule mem {C : context, mt_1 : memtype, mt_2 : memtype}: - `%|-%<:%`(C, MEM_externtype(mt_1), MEM_externtype(mt_2)) - -- Memtype_sub: `%|-%<:%`(C, mt_1, mt_2) + ;; 6-typing.watsup:485.1-487.39 + rule global {C : context, gt_1 : globaltype, gt_2 : globaltype}: + `%|-%<:%`(C, GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) + -- Globaltype_sub: `%|-%<:%`(C, gt_1, gt_2) + + ;; 6-typing.watsup:481.1-483.36 + rule func {C : context, dt_1 : deftype, dt_2 : deftype}: + `%|-%<:%`(C, FUNC_externtype(dt_1), FUNC_externtype(dt_2)) + -- Deftype_sub: `%|-%<:%`(C, dt_1, dt_2) ;; 6-typing.watsup:565.1-565.76 relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) - ;; 6-typing.watsup:567.1-568.32 - rule void {C : context}: - `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) + ;; 6-typing.watsup:573.1-575.34 + rule typeidx {C : context, ft : functype, x : idx}: + `%|-%:%`(C, _IDX_blocktype(x), ft) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(ft)) ;; 6-typing.watsup:570.1-571.28 rule result {C : context, t : valtype}: `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`([], [t])) - ;; 6-typing.watsup:573.1-575.34 - rule typeidx {C : context, ft : functype, x : idx}: - `%|-%:%`(C, _IDX_blocktype(x), ft) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(ft)) + ;; 6-typing.watsup:567.1-568.32 + rule void {C : context}: + `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) ;; 6-typing.watsup:503.1-505.74 rec { ;; 6-typing.watsup:503.1-503.67 relation Instr_ok: `%|-%:%`(context, instr, functype) - ;; 6-typing.watsup:544.1-545.34 - rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) - - ;; 6-typing.watsup:547.1-548.24 - rule nop {C : context}: - `%|-%:%`(C, NOP_instr, `%->%`([], [])) - - ;; 6-typing.watsup:550.1-551.23 - rule drop {C : context, t : valtype}: - `%|-%:%`(C, DROP_instr, `%->%`([t], [])) - - ;; 6-typing.watsup:554.1-555.31 - rule select-expl {C : context, t : valtype}: - `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) - - ;; 6-typing.watsup:557.1-560.37 - rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: - `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) - -- Valtype_sub: `%|-%<:%`(C, t, t') - -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) + ;; 6-typing.watsup:951.1-956.29 + rule store {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, x : idx, o0 : nat, o1? : nat?}: + `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype $valtype_numtype(nt)], [])) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- (if ($size($valtype_numtype(nt)) = ?(o1)))?{o1} + -- if (C.MEM_context[x] = mt) + -- if ((2 ^ n_A) <= (o0 / 8)) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} + -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) - ;; 6-typing.watsup:578.1-581.61 - rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:944.1-949.29 + rule load {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, x : idx, o0 : nat, o1? : nat?}: + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [$valtype_numtype(nt)])) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- (if ($size($valtype_numtype(nt)) = ?(o1)))?{o1} + -- if (C.MEM_context[x] = mt) + -- if ((2 ^ n_A) <= (o0 / 8)) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} + -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) - ;; 6-typing.watsup:583.1-586.61 - rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:940.1-942.23 + rule data.drop {C : context, x : idx}: + `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) + -- if (C.DATA_context[x] = OK) - ;; 6-typing.watsup:588.1-592.65 - rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: - `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) + ;; 6-typing.watsup:935.1-938.23 + rule memory.init {C : context, mt : memtype, x : idx, y : idx}: + `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x] = mt) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:597.1-599.24 - rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.LABEL_context[l] = t*{t}) + ;; 6-typing.watsup:930.1-933.26 + rule memory.copy {C : context, mt_1 : memtype, mt_2 : memtype, x_1 : idx, x_2 : idx}: + `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x_1] = mt_1) + -- if (C.MEM_context[x_2] = mt_2) - ;; 6-typing.watsup:601.1-603.24 - rule br_if {C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) - -- if (C.LABEL_context[l] = t*{t}) + ;; 6-typing.watsup:926.1-928.22 + rule memory.fill {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:605.1-608.44 - rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- (Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l]))*{l} - -- Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l']) + ;; 6-typing.watsup:922.1-924.22 + rule memory.grow {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:610.1-613.31 - rule br_on_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[l] = t*{t}) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:918.1-920.22 + rule memory.size {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:615.1-618.31 - rule br_on_non_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) - -- if (C.LABEL_context[l] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:911.1-913.23 + rule elem.drop {C : context, rt : reftype, x : idx}: + `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) + -- if (C.ELEM_context[x] = rt) - ;; 6-typing.watsup:620.1-626.34 - rule br_on_cast {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype($diffrt(rt_1, rt_2))])) - -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) - -- Reftype_ok: `%|-%:OK`(C, rt_1) - -- Reftype_ok: `%|-%:OK`(C, rt_2) + ;; 6-typing.watsup:905.1-909.36 + rule table.init {C : context, lim : limits, rt_1 : reftype, rt_2 : reftype, x : idx, y : idx}: + `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.TABLE_context[x] = `%%`(lim, rt_1)) + -- if (C.ELEM_context[y] = rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) - ;; 6-typing.watsup:628.1-634.49 - rule br_on_cast_fail {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype(rt_2)])) - -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) - -- Reftype_ok: `%|-%:OK`(C, rt_1) - -- Reftype_ok: `%|-%:OK`(C, rt_2) + ;; 6-typing.watsup:899.1-903.36 + rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt_1 : reftype, rt_2 : reftype, x_1 : idx, x_2 : idx}: + `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt_1)) + -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt_2)) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) - ;; 6-typing.watsup:639.1-641.24 - rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.RETURN_context = ?(t*{t})) + ;; 6-typing.watsup:895.1-897.28 + rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:643.1-645.46 - rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + ;; 6-typing.watsup:891.1-893.28 + rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:647.1-649.46 - rule call_ref {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_2*{t_2})) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + ;; 6-typing.watsup:887.1-889.24 + rule table.size {C : context, tt : tabletype, x : idx}: + `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) + -- if (C.TABLE_context[x] = tt) - ;; 6-typing.watsup:651.1-655.46 - rule call_indirect {C : context, lim : limits, rt : reftype, t_1* : valtype*, t_2* : valtype*, x : idx, y : idx}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + ;; 6-typing.watsup:883.1-885.28 + rule table.set {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - - ;; 6-typing.watsup:657.1-661.40 - rule return_call {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) - -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:663.1-667.40 - rule return_call_ref {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_4*{t_4})) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + ;; 6-typing.watsup:879.1-881.28 + rule table.get {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:669.1-675.40 - rule return_call_indirect {C : context, lim : limits, rt : reftype, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx, y : idx}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - - ;; 6-typing.watsup:680.1-681.33 - rule const {C : context, c_nt : c, nt : numtype}: - `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) - - ;; 6-typing.watsup:683.1-684.31 - rule unop {C : context, nt : numtype, unop : unop_numtype}: - `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - - ;; 6-typing.watsup:686.1-687.36 - rule binop {C : context, binop : binop_numtype, nt : numtype}: - `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) + ;; 6-typing.watsup:872.1-874.28 + rule global.set {C : context, t : valtype, x : idx}: + `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) + -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?(())), t)) - ;; 6-typing.watsup:689.1-690.36 - rule testop {C : context, nt : numtype, testop : testop_numtype}: - `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) + ;; 6-typing.watsup:868.1-870.28 + rule global.get {C : context, mut : mut, t : valtype, x : idx}: + `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) + -- if (C.GLOBAL_context[x] = `%%`(mut, t)) - ;; 6-typing.watsup:692.1-693.37 - rule relop {C : context, nt : numtype, relop : relop_numtype}: - `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) + ;; 6-typing.watsup:853.1-855.28 + rule local.get {C : context, init : init, t : valtype, x : idx}: + `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) + -- if (C.LOCAL_context[x] = `%%`(init, t)) - ;; 6-typing.watsup:696.1-698.23 - rule extend {C : context, n : n, nt : numtype, o0 : nat}: - `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if (n <= o0) + ;; 6-typing.watsup:847.1-848.62 + rule any.convert_extern {C : context, nul : nul}: + `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) - ;; 6-typing.watsup:700.1-703.34 - rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype, o0 : nat, o1 : nat}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) - -- if ($size($valtype_numtype(nt_1)) = ?(o0)) - -- if ($size($valtype_numtype(nt_2)) = ?(o1)) - -- if (nt_1 =/= nt_2) - -- if (o0 = o1) + ;; 6-typing.watsup:844.1-845.62 + rule extern.convert_any {C : context, nul : nul}: + `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) - ;; 6-typing.watsup:705.1-708.50 - rule convert-i {C : context, inn_1 : inn, inn_2 : inn, sx? : sx?, o0 : nat, o1 : nat}: - `%|-%:%`(C, CVTOP_instr($numtype_inn(inn_1), CONVERT_cvtop, $numtype_inn(inn_2), sx?{sx}), `%->%`([$valtype_inn(inn_2)], [$valtype_inn(inn_1)])) - -- if ($size($valtype_inn(inn_1)) = ?(o0)) - -- if ($size($valtype_inn(inn_2)) = ?(o1)) - -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> (o0 > o1)) + ;; 6-typing.watsup:835.1-839.23 + rule array.init_data {C : context, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:710.1-712.24 - rule convert-f {C : context, fnn_1 : fnn, fnn_2 : fnn}: - `%|-%:%`(C, CVTOP_instr($numtype_fnn(fnn_1), CONVERT_cvtop, $numtype_fnn(fnn_2), ?()), `%->%`([$valtype_fnn(fnn_2)], [$valtype_fnn(fnn_1)])) - -- if (fnn_1 =/= fnn_2) + ;; 6-typing.watsup:830.1-833.43 + rule array.init_elem {C : context, x : idx, y : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- Storagetype_sub: `%|-%<:%`(C, $storagetype_elemtype(C.ELEM_context[y]), zt) - ;; 6-typing.watsup:717.1-719.31 - rule ref.null {C : context, ht : heaptype}: - `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:824.1-828.40 + rule array.copy {C : context, mut : mut, x_1 : idx, x_2 : idx, zt_1 : storagetype, zt_2 : storagetype}: + `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_1))) I32_valtype REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_2))) I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x_1], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) + -- Expand: `%~~%`(C.TYPE_context[x_2], ARRAY_comptype(`%%`(mut, zt_2))) + -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) - ;; 6-typing.watsup:722.1-724.23 - rule ref.func {C : context, dt : deftype, epsilon : resulttype, x : idx}: - `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), $heaptype_deftype(dt))])) - -- if (C.FUNC_context[x] = dt) + ;; 6-typing.watsup:820.1-822.41 + rule array.fill {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt) I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:726.1-727.34 - rule ref.i31 {C : context}: - `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) + ;; 6-typing.watsup:816.1-818.41 + rule array.len {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:729.1-730.31 - rule ref.is_null {C : context, rt : reftype}: - `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) + ;; 6-typing.watsup:812.1-814.41 + rule array.set {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt)], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:732.1-734.31 - rule ref.as_non_null {C : context, ht : heaptype}: - `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:807.1-810.43 + rule array.get {C : context, mut : mut, sx? : sx?, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype], [$unpacktype(zt)])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) - ;; 6-typing.watsup:736.1-737.51 - rule ref.eq {C : context}: - `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) + ;; 6-typing.watsup:801.1-805.23 + rule array.new_data {C : context, mut : mut, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx}: + `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_valtype(t)))) + -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:739.1-743.33 - rule ref.test {C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([$valtype_reftype(rt')], [I32_valtype])) - -- Reftype_ok: `%|-%:OK`(C, rt) - -- Reftype_ok: `%|-%:OK`(C, rt') - -- Reftype_sub: `%|-%<:%`(C, rt, rt') + ;; 6-typing.watsup:796.1-799.39 + rule array.new_elem {C : context, mut : mut, rt : reftype, x : idx, y : idx}: + `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_reftype(rt)))) + -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y], rt) - ;; 6-typing.watsup:745.1-749.33 - rule ref.cast {C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([$valtype_reftype(rt')], [$valtype_reftype(rt)])) - -- Reftype_ok: `%|-%:OK`(C, rt) - -- Reftype_ok: `%|-%:OK`(C, rt') - -- Reftype_sub: `%|-%<:%`(C, rt, rt') + ;; 6-typing.watsup:792.1-794.41 + rule array.new_fixed {C : context, mut : mut, n : n, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpacktype(zt)], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - ;; 6-typing.watsup:754.1-755.42 - rule i31.get {C : context, sx : sx}: - `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) + ;; 6-typing.watsup:787.1-790.40 + rule array.new_default {C : context, mut : mut, val : val, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- if ($default($unpacktype(zt)) = ?(val)) - ;; 6-typing.watsup:760.1-762.43 - rule struct.new {C : context, mut* : mut*, x : idx, zt* : storagetype*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + ;; 6-typing.watsup:783.1-785.41 + rule array.new {C : context, mut : mut, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpacktype(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - ;; 6-typing.watsup:764.1-767.43 - rule struct.new_default {C : context, mut* : mut*, val* : val*, x : idx, zt* : storagetype*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} + ;; 6-typing.watsup:775.1-778.24 + rule struct.set {C : context, i : nat, x : idx, yt* : fieldtype*, zt : storagetype}: + `%|-%:%`(C, STRUCT.SET_instr(x, i), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) $unpacktype(zt)], [])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) + -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) ;; 6-typing.watsup:769.1-773.43 rule struct.get {C : context, i : nat, mut : mut, sx? : sx?, x : idx, yt* : fieldtype*, zt : storagetype}: @@ -14868,223 +14971,270 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- if (yt*{yt}[i] = `%%`(mut, zt)) -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) - ;; 6-typing.watsup:775.1-778.24 - rule struct.set {C : context, i : nat, x : idx, yt* : fieldtype*, zt : storagetype}: - `%|-%:%`(C, STRUCT.SET_instr(x, i), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) $unpacktype(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) + ;; 6-typing.watsup:764.1-767.43 + rule struct.new_default {C : context, mut* : mut*, val* : val*, x : idx, zt* : storagetype*}: + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} - ;; 6-typing.watsup:783.1-785.41 - rule array.new {C : context, mut : mut, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpacktype(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + ;; 6-typing.watsup:760.1-762.43 + rule struct.new {C : context, mut* : mut*, x : idx, zt* : storagetype*}: + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - ;; 6-typing.watsup:787.1-790.40 - rule array.new_default {C : context, mut : mut, val : val, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - -- if ($default($unpacktype(zt)) = ?(val)) + ;; 6-typing.watsup:754.1-755.42 + rule i31.get {C : context, sx : sx}: + `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) - ;; 6-typing.watsup:792.1-794.41 - rule array.new_fixed {C : context, mut : mut, n : n, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpacktype(zt)], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + ;; 6-typing.watsup:745.1-749.33 + rule ref.cast {C : context, rt : reftype, rt' : reftype}: + `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([$valtype_reftype(rt')], [$valtype_reftype(rt)])) + -- Reftype_ok: `%|-%:OK`(C, rt) + -- Reftype_ok: `%|-%:OK`(C, rt') + -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:796.1-799.39 - rule array.new_elem {C : context, mut : mut, rt : reftype, x : idx, y : idx}: - `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_reftype(rt)))) - -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y], rt) + ;; 6-typing.watsup:739.1-743.33 + rule ref.test {C : context, rt : reftype, rt' : reftype}: + `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([$valtype_reftype(rt')], [I32_valtype])) + -- Reftype_ok: `%|-%:OK`(C, rt) + -- Reftype_ok: `%|-%:OK`(C, rt') + -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:801.1-805.23 - rule array.new_data {C : context, mut : mut, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx}: - `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_valtype(t)))) - -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:736.1-737.51 + rule ref.eq {C : context}: + `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) - ;; 6-typing.watsup:807.1-810.43 - rule array.get {C : context, mut : mut, sx? : sx?, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype], [$unpacktype(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) + ;; 6-typing.watsup:732.1-734.31 + rule ref.as_non_null {C : context, ht : heaptype}: + `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:812.1-814.41 - rule array.set {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:729.1-730.31 + rule ref.is_null {C : context, rt : reftype}: + `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) - ;; 6-typing.watsup:816.1-818.41 - rule array.len {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:726.1-727.34 + rule ref.i31 {C : context}: + `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) - ;; 6-typing.watsup:820.1-822.41 - rule array.fill {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt) I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:722.1-724.23 + rule ref.func {C : context, dt : deftype, epsilon : resulttype, x : idx}: + `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), $heaptype_deftype(dt))])) + -- if (C.FUNC_context[x] = dt) - ;; 6-typing.watsup:824.1-828.40 - rule array.copy {C : context, mut : mut, x_1 : idx, x_2 : idx, zt_1 : storagetype, zt_2 : storagetype}: - `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_1))) I32_valtype REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_2))) I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x_1], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) - -- Expand: `%~~%`(C.TYPE_context[x_2], ARRAY_comptype(`%%`(mut, zt_2))) - -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) + ;; 6-typing.watsup:717.1-719.31 + rule ref.null {C : context, ht : heaptype}: + `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:830.1-833.43 - rule array.init_elem {C : context, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- Storagetype_sub: `%|-%<:%`(C, $storagetype_elemtype(C.ELEM_context[y]), zt) + ;; 6-typing.watsup:710.1-712.24 + rule convert-f {C : context, fnn_1 : fnn, fnn_2 : fnn}: + `%|-%:%`(C, CVTOP_instr($numtype_fnn(fnn_1), CONVERT_cvtop, $numtype_fnn(fnn_2), ?()), `%->%`([$valtype_fnn(fnn_2)], [$valtype_fnn(fnn_1)])) + -- if (fnn_1 =/= fnn_2) - ;; 6-typing.watsup:835.1-839.23 - rule array.init_data {C : context, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:705.1-708.50 + rule convert-i {C : context, inn_1 : inn, inn_2 : inn, sx? : sx?, o0 : nat, o1 : nat}: + `%|-%:%`(C, CVTOP_instr($numtype_inn(inn_1), CONVERT_cvtop, $numtype_inn(inn_2), sx?{sx}), `%->%`([$valtype_inn(inn_2)], [$valtype_inn(inn_1)])) + -- if ($size($valtype_inn(inn_1)) = ?(o0)) + -- if ($size($valtype_inn(inn_2)) = ?(o1)) + -- if (inn_1 =/= inn_2) + -- if ((sx?{sx} = ?()) <=> (o0 > o1)) - ;; 6-typing.watsup:844.1-845.62 - rule extern.convert_any {C : context, nul : nul}: - `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) + ;; 6-typing.watsup:700.1-703.34 + rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype, o0 : nat, o1 : nat}: + `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) + -- if ($size($valtype_numtype(nt_1)) = ?(o0)) + -- if ($size($valtype_numtype(nt_2)) = ?(o1)) + -- if (nt_1 =/= nt_2) + -- if (o0 = o1) - ;; 6-typing.watsup:847.1-848.62 - rule any.convert_extern {C : context, nul : nul}: - `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) + ;; 6-typing.watsup:696.1-698.23 + rule extend {C : context, n : n, nt : numtype, o0 : nat}: + `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if (n <= o0) - ;; 6-typing.watsup:853.1-855.28 - rule local.get {C : context, init : init, t : valtype, x : idx}: - `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) - -- if (C.LOCAL_context[x] = `%%`(init, t)) + ;; 6-typing.watsup:692.1-693.37 + rule relop {C : context, nt : numtype, relop : relop_numtype}: + `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) - ;; 6-typing.watsup:868.1-870.28 - rule global.get {C : context, mut : mut, t : valtype, x : idx}: - `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) - -- if (C.GLOBAL_context[x] = `%%`(mut, t)) + ;; 6-typing.watsup:689.1-690.36 + rule testop {C : context, nt : numtype, testop : testop_numtype}: + `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) - ;; 6-typing.watsup:872.1-874.28 - rule global.set {C : context, t : valtype, x : idx}: - `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) - -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?(())), t)) + ;; 6-typing.watsup:686.1-687.36 + rule binop {C : context, binop : binop_numtype, nt : numtype}: + `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:879.1-881.28 - rule table.get {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:683.1-684.31 + rule unop {C : context, nt : numtype, unop : unop_numtype}: + `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:883.1-885.28 - rule table.set {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) + ;; 6-typing.watsup:680.1-681.33 + rule const {C : context, c_nt : c, nt : numtype}: + `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) + + ;; 6-typing.watsup:669.1-675.40 + rule return_call_indirect {C : context, lim : limits, rt : reftype, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx, y : idx}: + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) + -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:887.1-889.24 - rule table.size {C : context, tt : tabletype, x : idx}: - `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) - -- if (C.TABLE_context[x] = tt) + ;; 6-typing.watsup:663.1-667.40 + rule return_call_ref {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_4*{t_4})) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:891.1-893.28 - rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:657.1-661.40 + rule return_call {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) + -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:895.1-897.28 - rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) + ;; 6-typing.watsup:651.1-655.46 + rule call_indirect {C : context, lim : limits, rt : reftype, t_1* : valtype*, t_2* : valtype*, x : idx, y : idx}: + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) + -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:899.1-903.36 - rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt_1 : reftype, rt_2 : reftype, x_1 : idx, x_2 : idx}: - `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt_1)) - -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt_2)) + ;; 6-typing.watsup:647.1-649.46 + rule call_ref {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_2*{t_2})) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + + ;; 6-typing.watsup:643.1-645.46 + rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: + `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + + ;; 6-typing.watsup:639.1-641.24 + rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- if (C.RETURN_context = ?(t*{t})) + + ;; 6-typing.watsup:628.1-634.49 + rule br_on_cast_fail {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype(rt_2)])) + -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) + -- Reftype_ok: `%|-%:OK`(C, rt_1) + -- Reftype_ok: `%|-%:OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) - ;; 6-typing.watsup:905.1-909.36 - rule table.init {C : context, lim : limits, rt_1 : reftype, rt_2 : reftype, x : idx, y : idx}: - `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.TABLE_context[x] = `%%`(lim, rt_1)) - -- if (C.ELEM_context[y] = rt_2) + ;; 6-typing.watsup:620.1-626.34 + rule br_on_cast {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype($diffrt(rt_1, rt_2))])) + -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) + -- Reftype_ok: `%|-%:OK`(C, rt_1) + -- Reftype_ok: `%|-%:OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) - ;; 6-typing.watsup:911.1-913.23 - rule elem.drop {C : context, rt : reftype, x : idx}: - `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) - -- if (C.ELEM_context[x] = rt) + ;; 6-typing.watsup:615.1-618.31 + rule br_on_non_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) + -- if (C.LABEL_context[l] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:918.1-920.22 - rule memory.size {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:610.1-613.31 + rule br_on_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) + -- if (C.LABEL_context[l] = t*{t}) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:922.1-924.22 - rule memory.grow {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:605.1-608.44 + rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- (Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l]))*{l} + -- Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l']) - ;; 6-typing.watsup:926.1-928.22 - rule memory.fill {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:601.1-603.24 + rule br_if {C : context, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) + -- if (C.LABEL_context[l] = t*{t}) - ;; 6-typing.watsup:930.1-933.26 - rule memory.copy {C : context, mt_1 : memtype, mt_2 : memtype, x_1 : idx, x_2 : idx}: - `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x_1] = mt_1) - -- if (C.MEM_context[x_2] = mt_2) + ;; 6-typing.watsup:597.1-599.24 + rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- if (C.LABEL_context[l] = t*{t}) - ;; 6-typing.watsup:935.1-938.23 - rule memory.init {C : context, mt : memtype, x : idx, y : idx}: - `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x] = mt) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:588.1-592.65 + rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) - ;; 6-typing.watsup:940.1-942.23 - rule data.drop {C : context, x : idx}: - `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) - -- if (C.DATA_context[x] = OK) + ;; 6-typing.watsup:583.1-586.61 + rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - ;; 6-typing.watsup:944.1-949.29 - rule load {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, x : idx, o0 : nat, o1? : nat?}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [$valtype_numtype(nt)])) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- (if ($size($valtype_numtype(nt)) = ?(o1)))?{o1} - -- if (C.MEM_context[x] = mt) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} - -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) + ;; 6-typing.watsup:578.1-581.61 + rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - ;; 6-typing.watsup:951.1-956.29 - rule store {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, x : idx, o0 : nat, o1? : nat?}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype $valtype_numtype(nt)], [])) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- (if ($size($valtype_numtype(nt)) = ?(o1)))?{o1} - -- if (C.MEM_context[x] = mt) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} - -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) + ;; 6-typing.watsup:557.1-560.37 + rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: + `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) + -- Valtype_sub: `%|-%<:%`(C, t, t') + -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) + + ;; 6-typing.watsup:554.1-555.31 + rule select-expl {C : context, t : valtype}: + `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) + + ;; 6-typing.watsup:550.1-551.23 + rule drop {C : context, t : valtype}: + `%|-%:%`(C, DROP_instr, `%->%`([t], [])) + + ;; 6-typing.watsup:547.1-548.24 + rule nop {C : context}: + `%|-%:%`(C, NOP_instr, `%->%`([], [])) + + ;; 6-typing.watsup:544.1-545.34 + rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) ;; 6-typing.watsup:504.1-504.67 relation Instrf_ok: `%|-%:%`(context, instr, instrtype) - ;; 6-typing.watsup:518.1-520.41 - rule instr {C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + ;; 6-typing.watsup:861.1-863.28 + rule local.tee {C : context, init : init, t : valtype, x : idx}: + `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) + -- if (C.LOCAL_context[x] = `%%`(init, t)) ;; 6-typing.watsup:857.1-859.28 rule local.set {C : context, init : init, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) -- if (C.LOCAL_context[x] = `%%`(init, t)) - ;; 6-typing.watsup:861.1-863.28 - rule local.tee {C : context, init : init, t : valtype, x : idx}: - `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) - -- if (C.LOCAL_context[x] = `%%`(init, t)) + ;; 6-typing.watsup:518.1-520.41 + rule instr {C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) ;; 6-typing.watsup:505.1-505.74 relation Instrs_ok: `%|-%*:%`(context, instr*, instrtype) - ;; 6-typing.watsup:522.1-523.29 - rule empty {C : context}: - `%|-%*:%`(C, [], `%->%*%`([], [], [])) + ;; 6-typing.watsup:537.1-539.47 + rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%*:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + + ;; 6-typing.watsup:532.1-535.35 + rule sub {C : context, instr* : instr*, it : instrtype, it' : instrtype}: + `%|-%*:%`(C, instr*{instr}, it') + -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, it) + -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:525.1-530.52 rule seq {C : context, C' : context, init* : init*, instr_1 : instr, instr_2* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, x_1* : idx*, x_2* : idx*}: @@ -15094,16 +15244,9 @@ relation Instrs_ok: `%|-%*:%`(context, instr*, instrtype) -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) -- Instrs_ok: `%|-%*:%`(C', instr_2*{instr_2}, `%->%*%`(t_2*{t_2}, x_2*{x_2}, t_3*{t_3})) - ;; 6-typing.watsup:532.1-535.35 - rule sub {C : context, instr* : instr*, it : instrtype, it' : instrtype}: - `%|-%*:%`(C, instr*{instr}, it') - -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, it) - -- Instrtype_sub: `%|-%<:%`(C, it, it') - - ;; 6-typing.watsup:537.1-539.47 - rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%*:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:522.1-523.29 + rule empty {C : context}: + `%|-%*:%`(C, [], `%->%*%`([], [], [])) } ;; 6-typing.watsup:506.1-506.72 @@ -15118,10 +15261,10 @@ rec { ;; 6-typing.watsup:985.1-985.64 def in_binop : (binop_numtype, ibinop*) -> bool - ;; 6-typing.watsup:986.1-986.38 - def {binop : binop_numtype, epsilon : ibinop*} in_binop(binop, epsilon) = false ;; 6-typing.watsup:987.1-987.92 def {binop : binop_numtype, ibinop'* : ibinop*, ibinop_1 : ibinop} in_binop(binop, [ibinop_1] :: ibinop'*{ibinop'}) = ((binop = _I_binop_numtype(ibinop_1)) \/ $in_binop(binop, ibinop'*{ibinop'})) + ;; 6-typing.watsup:986.1-986.38 + def {binop : binop_numtype, epsilon : ibinop*} in_binop(binop, epsilon) = false } ;; 6-typing.watsup:981.1-981.63 @@ -15129,36 +15272,36 @@ rec { ;; 6-typing.watsup:981.1-981.63 def in_numtype : (numtype, numtype*) -> bool - ;; 6-typing.watsup:982.1-982.37 - def {epsilon : numtype*, nt : numtype} in_numtype(nt, epsilon) = false ;; 6-typing.watsup:983.1-983.68 def {nt : numtype, nt'* : numtype*, nt_1 : numtype} in_numtype(nt, [nt_1] :: nt'*{nt'}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt'})) + ;; 6-typing.watsup:982.1-982.37 + def {epsilon : numtype*, nt : numtype} in_numtype(nt, epsilon) = false } ;; 6-typing.watsup:963.1-963.78 relation Instr_const: `%|-%CONST`(context, instr) - ;; 6-typing.watsup:967.1-968.26 - rule const {C : context, c : c, nt : numtype}: - `%|-%CONST`(C, CONST_instr(nt, c)) + ;; 6-typing.watsup:989.1-992.38 + rule binop {C : context, binop : binop_numtype, nt : numtype}: + `%|-%CONST`(C, BINOP_instr(nt, binop)) + -- if $in_numtype(nt, [I32_numtype I64_numtype]) + -- if $in_binop(binop, [ADD_ibinop SUB_ibinop MUL_ibinop]) - ;; 6-typing.watsup:970.1-971.27 - rule ref.null {C : context, ht : heaptype}: - `%|-%CONST`(C, REF.NULL_instr(ht)) + ;; 6-typing.watsup:976.1-978.24 + rule global.get {C : context, t : valtype, x : idx}: + `%|-%CONST`(C, GLOBAL.GET_instr(x)) + -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?()), t)) ;; 6-typing.watsup:973.1-974.26 rule ref.func {C : context, x : idx}: `%|-%CONST`(C, REF.FUNC_instr(x)) - ;; 6-typing.watsup:976.1-978.24 - rule global.get {C : context, t : valtype, x : idx}: - `%|-%CONST`(C, GLOBAL.GET_instr(x)) - -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?()), t)) + ;; 6-typing.watsup:970.1-971.27 + rule ref.null {C : context, ht : heaptype}: + `%|-%CONST`(C, REF.NULL_instr(ht)) - ;; 6-typing.watsup:989.1-992.38 - rule binop {C : context, binop : binop_numtype, nt : numtype}: - `%|-%CONST`(C, BINOP_instr(nt, binop)) - -- if $in_numtype(nt, [I32_numtype I64_numtype]) - -- if $in_binop(binop, [ADD_ibinop SUB_ibinop MUL_ibinop]) + ;; 6-typing.watsup:967.1-968.26 + rule const {C : context, c : c, nt : numtype}: + `%|-%CONST`(C, CONST_instr(nt, c)) ;; 6-typing.watsup:964.1-964.77 relation Expr_const: `%|-%CONST`(context, expr) @@ -15186,16 +15329,16 @@ relation Type_ok: `%|-%:%*`(context, type, deftype*) ;; 6-typing.watsup:1013.1-1013.74 relation Local_ok: `%|-%:%`(context, local, localtype) - ;; 6-typing.watsup:1029.1-1031.28 - rule set {C : context, t : valtype}: - `%|-%:%`(C, LOCAL(t), `%%`(SET_init, t)) - -- if ($default(t) =/= ?()) - ;; 6-typing.watsup:1033.1-1035.26 rule unset {C : context, t : valtype}: `%|-%:%`(C, LOCAL(t), `%%`(UNSET_init, t)) -- if ($default(t) = ?()) + ;; 6-typing.watsup:1029.1-1031.28 + rule set {C : context, t : valtype}: + `%|-%:%`(C, LOCAL(t), `%%`(SET_init, t)) + -- if ($default(t) =/= ?()) + ;; 6-typing.watsup:1012.1-1012.73 relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup:1037.1-1041.82 @@ -15232,19 +15375,19 @@ relation Mem_ok: `%|-%:%`(context, mem, memtype) ;; 6-typing.watsup:1019.1-1019.77 relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) - ;; 6-typing.watsup:1068.1-1071.45 - rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} + ;; 6-typing.watsup:1076.1-1077.20 + rule declare {C : context, rt : reftype}: + `%|-%:%`(C, DECLARE_elemmode, rt) ;; 6-typing.watsup:1073.1-1074.20 rule passive {C : context, rt : reftype}: `%|-%:%`(C, PASSIVE_elemmode, rt) - ;; 6-typing.watsup:1076.1-1077.20 - rule declare {C : context, rt : reftype}: - `%|-%:%`(C, DECLARE_elemmode, rt) + ;; 6-typing.watsup:1068.1-1071.45 + rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup:1017.1-1017.73 relation Elem_ok: `%|-%:%`(context, elem, reftype) @@ -15256,16 +15399,16 @@ relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup:1020.1-1020.77 relation Datamode_ok: `%|-%:OK`(context, datamode) + ;; 6-typing.watsup:1084.1-1085.20 + rule passive {C : context}: + `%|-%:OK`(C, PASSIVE_datamode) + ;; 6-typing.watsup:1079.1-1082.45 rule active {C : context, expr : expr, mt : memtype, x : idx}: `%|-%:OK`(C, ACTIVE_datamode(x, expr)) -- if (C.MEM_context[x] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 6-typing.watsup:1084.1-1085.20 - rule passive {C : context}: - `%|-%:OK`(C, PASSIVE_datamode) - ;; 6-typing.watsup:1018.1-1018.73 relation Data_ok: `%|-%:OK`(context, data) ;; 6-typing.watsup:1064.1-1066.37 @@ -15289,25 +15432,25 @@ relation Import_ok: `%|-%:%`(context, import, externtype) ;; 6-typing.watsup:1096.1-1096.83 relation Externidx_ok: `%|-%:%`(context, externidx, externtype) - ;; 6-typing.watsup:1107.1-1109.23 - rule func {C : context, dt : deftype, x : idx}: - `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) - -- if (C.FUNC_context[x] = dt) - - ;; 6-typing.watsup:1111.1-1113.25 - rule global {C : context, gt : globaltype, x : idx}: - `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) - -- if (C.GLOBAL_context[x] = gt) + ;; 6-typing.watsup:1119.1-1121.22 + rule mem {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) + -- if (C.MEM_context[x] = mt) ;; 6-typing.watsup:1115.1-1117.24 rule table {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE_externidx(x), TABLE_externtype(tt)) -- if (C.TABLE_context[x] = tt) - ;; 6-typing.watsup:1119.1-1121.22 - rule mem {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:1111.1-1113.25 + rule global {C : context, gt : globaltype, x : idx}: + `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) + -- if (C.GLOBAL_context[x] = gt) + + ;; 6-typing.watsup:1107.1-1109.23 + rule func {C : context, dt : deftype, x : idx}: + `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) + -- if (C.FUNC_context[x] = dt) ;; 6-typing.watsup:1095.1-1095.80 relation Export_ok: `%|-%:%`(context, export, externtype) @@ -15321,15 +15464,15 @@ rec { ;; 6-typing.watsup:1128.1-1128.77 relation Globals_ok: `%|-%*:%*`(context, global*, globaltype*) - ;; 6-typing.watsup:1171.1-1172.17 - rule empty {C : context}: - `%|-%*:%*`(C, [], []) - ;; 6-typing.watsup:1174.1-1177.54 rule cons {C : context, global : global, global_1 : global, gt* : globaltype*, gt_1 : globaltype}: `%|-%*:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt}) -- Global_ok: `%|-%:%`(C, global, gt_1) -- Globals_ok: `%|-%*:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt}) + + ;; 6-typing.watsup:1171.1-1172.17 + rule empty {C : context}: + `%|-%*:%*`(C, [], []) } ;; 6-typing.watsup:1127.1-1127.75 @@ -15337,15 +15480,15 @@ rec { ;; 6-typing.watsup:1127.1-1127.75 relation Types_ok: `%|-%*:%*`(context, type*, deftype*) - ;; 6-typing.watsup:1163.1-1164.17 - rule empty {C : context}: - `%|-%*:%*`(C, [], []) - ;; 6-typing.watsup:1166.1-1169.49 rule cons {C : context, dt* : deftype*, dt_1 : deftype, type* : type*, type_1 : type}: `%|-%*:%*`(C, [type_1] :: type*{type}, dt_1*{} :: dt*{dt}) -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) -- Types_ok: `%|-%*:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, dt*{dt}) + + ;; 6-typing.watsup:1163.1-1164.17 + rule empty {C : context}: + `%|-%*:%*`(C, [], []) } ;; 6-typing.watsup:1126.1-1126.76 @@ -15372,475 +15515,489 @@ relation Module_ok: `|-%:OK`(module) ;; 7-runtime-typing.watsup:5.1-5.40 relation Ref_ok: `%|-%:%`(store, ref, reftype) - ;; 7-runtime-typing.watsup:7.1-8.35 - rule null {ht : heaptype, s : store}: - `%|-%:%`(s, REF.NULL_ref(ht), REF_reftype(`NULL%?`(?(())), ht)) + ;; 7-runtime-typing.watsup:28.1-29.45 + rule extern {addrref : addrref, s : store}: + `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) - ;; 7-runtime-typing.watsup:10.1-11.37 - rule i31 {i : nat, s : store}: - `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) + ;; 7-runtime-typing.watsup:25.1-26.39 + rule host {a : addr, s : store}: + `%|-%:%`(s, REF.HOST_ADDR_ref(a), REF_reftype(`NULL%?`(?()), ANY_heaptype)) - ;; 7-runtime-typing.watsup:13.1-15.30 - rule struct {a : addr, dt : deftype, s : store}: - `%|-%:%`(s, REF.STRUCT_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) - -- if (s.STRUCT_store[a].TYPE_structinst = dt) + ;; 7-runtime-typing.watsup:21.1-23.28 + rule func {a : addr, dt : deftype, s : store}: + `%|-%:%`(s, REF.FUNC_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) + -- if (s.FUNC_store[a].TYPE_funcinst = dt) ;; 7-runtime-typing.watsup:17.1-19.29 rule array {a : addr, dt : deftype, s : store}: `%|-%:%`(s, REF.ARRAY_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) -- if (s.ARRAY_store[a].TYPE_arrayinst = dt) - ;; 7-runtime-typing.watsup:21.1-23.28 - rule func {a : addr, dt : deftype, s : store}: - `%|-%:%`(s, REF.FUNC_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) - -- if (s.FUNC_store[a].TYPE_funcinst = dt) + ;; 7-runtime-typing.watsup:13.1-15.30 + rule struct {a : addr, dt : deftype, s : store}: + `%|-%:%`(s, REF.STRUCT_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) + -- if (s.STRUCT_store[a].TYPE_structinst = dt) - ;; 7-runtime-typing.watsup:25.1-26.39 - rule host {a : addr, s : store}: - `%|-%:%`(s, REF.HOST_ADDR_ref(a), REF_reftype(`NULL%?`(?()), ANY_heaptype)) + ;; 7-runtime-typing.watsup:10.1-11.37 + rule i31 {i : nat, s : store}: + `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) - ;; 7-runtime-typing.watsup:28.1-29.45 - rule extern {addrref : addrref, s : store}: - `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) + ;; 7-runtime-typing.watsup:7.1-8.35 + rule null {ht : heaptype, s : store}: + `%|-%:%`(s, REF.NULL_ref(ht), REF_reftype(`NULL%?`(?(())), ht)) ;; 8-reduction.watsup:6.1-6.63 relation Step_pure: `%*~>%*`(admininstr*, admininstr*) - ;; 8-reduction.watsup:42.1-43.24 - rule unreachable: - `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) - - ;; 8-reduction.watsup:45.1-46.15 - rule nop: - `%*~>%*`([NOP_admininstr], []) + ;; 8-reduction.watsup:552.1-553.47 + rule local.tee {val : val, x : idx}: + `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) - ;; 8-reduction.watsup:48.1-49.20 - rule drop {val : val}: - `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) + ;; 8-reduction.watsup:539.1-540.55 + rule any.convert_extern-addr {addrref : addrref}: + `%*~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [$admininstr_addrref(addrref)]) - ;; 8-reduction.watsup:52.1-54.16 - rule select-true {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: - `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_1)]) - -- if (c =/= 0) + ;; 8-reduction.watsup:536.1-537.55 + rule any.convert_extern-null {ht : heaptype}: + `%*~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) - ;; 8-reduction.watsup:56.1-58.14 - rule select-false {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: - `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_2)]) - -- if (c = 0) + ;; 8-reduction.watsup:532.1-533.55 + rule extern.convert_any-addr {addrref : addrref}: + `%*~>%*`([$admininstr_addrref(addrref) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) - ;; 8-reduction.watsup:76.1-78.16 - rule if-true {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) - -- if (c =/= 0) + ;; 8-reduction.watsup:529.1-530.58 + rule extern.convert_any-null {ht : heaptype}: + `%*~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) - ;; 8-reduction.watsup:80.1-82.14 - rule if-false {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) - -- if (c = 0) + ;; 8-reduction.watsup:311.1-312.68 + rule i31.get-num {i : nat, sx : sx}: + `%*~>%*`([REF.I31_NUM_admininstr(i) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, i))]) - ;; 8-reduction.watsup:85.1-86.38 - rule label-vals {instr* : instr*, n : n, val* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) - - ;; 8-reduction.watsup:92.1-93.69 - rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) - - ;; 8-reduction.watsup:95.1-96.65 - rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) + ;; 8-reduction.watsup:308.1-309.39 + rule i31.get-null {ht : heaptype, sx : sx}: + `%*~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) - ;; 8-reduction.watsup:99.1-101.16 - rule br_if-true {c : c, l : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) - -- if (c =/= 0) + ;; 8-reduction.watsup:281.1-283.15 + rule ref.eq-false {ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 0)]) + -- otherwise - ;; 8-reduction.watsup:103.1-105.14 - rule br_if-false {c : c, l : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) - -- if (c = 0) + ;; 8-reduction.watsup:276.1-279.22 + rule ref.eq-true {ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- otherwise + -- if (ref_1 = ref_2) - ;; 8-reduction.watsup:108.1-110.17 - rule br_table-lt {i : nat, l* : labelidx*, l' : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) - -- if (i < |l*{l}|) + ;; 8-reduction.watsup:272.1-274.55 + rule ref.eq-null {ht_1 : heaptype, ht_2 : heaptype, ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) - ;; 8-reduction.watsup:112.1-114.18 - rule br_table-ge {i : nat, l* : labelidx*, l' : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) - -- if (i >= |l*{l}|) + ;; 8-reduction.watsup:267.1-269.15 + rule ref.as_non_null-addr {ref : ref}: + `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [$admininstr_ref(ref)]) + -- otherwise - ;; 8-reduction.watsup:117.1-119.26 - rule br_on_null-null {ht : heaptype, l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) - -- if (val = REF.NULL_val(ht)) + ;; 8-reduction.watsup:263.1-265.28 + rule ref.as_non_null-null {ht : heaptype, ref : ref}: + `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) + -- if (ref = REF.NULL_ref(ht)) - ;; 8-reduction.watsup:121.1-123.15 - rule br_on_null-addr {l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [$admininstr_val(val)]) + ;; 8-reduction.watsup:258.1-260.15 + rule ref.is_null-false {val : val}: + `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 8-reduction.watsup:126.1-128.26 - rule br_on_non_null-null {ht : heaptype, l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], []) + ;; 8-reduction.watsup:254.1-256.28 + rule ref.is_null-true {ht : heaptype, val : val}: + `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:130.1-132.15 - rule br_on_non_null-addr {l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], [$admininstr_val(val) BR_admininstr(l)]) - -- otherwise - - ;; 8-reduction.watsup:186.1-187.84 - rule call_indirect-call {x : idx, y : idx}: - `%*~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) CALL_REF_admininstr(?(y))]) + ;; 8-reduction.watsup:250.1-251.60 + rule ref.i31 {i : nat}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, i))]) - ;; 8-reduction.watsup:189.1-190.98 - rule return_call_indirect {x : idx, y : idx}: - `%*~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) RETURN_CALL_REF_admininstr(?(y))]) + ;; 8-reduction.watsup:240.1-242.50 + rule cvtop-trap {c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: + `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) + -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = []) - ;; 8-reduction.watsup:193.1-194.35 - rule frame-vals {f : frame, n : n, val^n : val^n}: - `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) + ;; 8-reduction.watsup:236.1-238.48 + rule cvtop-val {c : c, c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: + `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) + -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = [c]) - ;; 8-reduction.watsup:196.1-197.55 - rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: - `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) + ;; 8-reduction.watsup:232.1-233.70 + rule extend {c : c, n : n, nt : numtype, o0 : nat}: + `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, o0, S_sx, c))]) + -- if ($size($valtype_numtype(nt)) = ?(o0)) - ;; 8-reduction.watsup:199.1-200.60 - rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: - `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) + ;; 8-reduction.watsup:227.1-229.40 + rule relop {c : c, c_1 : c, c_2 : c, nt : numtype, relop : relop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) + -- if (c = $relop(relop, nt, c_1, c_2)) - ;; 8-reduction.watsup:205.1-207.33 - rule unop-val {c : c, c_1 : c, nt : numtype, unop : unop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) - -- if ($unop(unop, nt, c_1) = [c]) + ;; 8-reduction.watsup:223.1-225.37 + rule testop {c : c, c_1 : c, nt : numtype, testop : testop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) + -- if (c = $testop(testop, nt, c_1)) - ;; 8-reduction.watsup:209.1-211.35 - rule unop-trap {c_1 : c, nt : numtype, unop : unop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) - -- if ($unop(unop, nt, c_1) = []) + ;; 8-reduction.watsup:218.1-220.42 + rule binop-trap {binop : binop_numtype, c_1 : c, c_2 : c, nt : numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) + -- if ($binop(binop, nt, c_1, c_2) = []) ;; 8-reduction.watsup:214.1-216.40 rule binop-val {binop : binop_numtype, c : c, c_1 : c, c_2 : c, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(binop, nt, c_1, c_2) = [c]) - ;; 8-reduction.watsup:218.1-220.42 - rule binop-trap {binop : binop_numtype, c_1 : c, c_2 : c, nt : numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) - -- if ($binop(binop, nt, c_1, c_2) = []) - - ;; 8-reduction.watsup:223.1-225.37 - rule testop {c : c, c_1 : c, nt : numtype, testop : testop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) - -- if (c = $testop(testop, nt, c_1)) + ;; 8-reduction.watsup:209.1-211.35 + rule unop-trap {c_1 : c, nt : numtype, unop : unop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) + -- if ($unop(unop, nt, c_1) = []) - ;; 8-reduction.watsup:227.1-229.40 - rule relop {c : c, c_1 : c, c_2 : c, nt : numtype, relop : relop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) - -- if (c = $relop(relop, nt, c_1, c_2)) + ;; 8-reduction.watsup:205.1-207.33 + rule unop-val {c : c, c_1 : c, nt : numtype, unop : unop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) + -- if ($unop(unop, nt, c_1) = [c]) - ;; 8-reduction.watsup:232.1-233.70 - rule extend {c : c, n : n, nt : numtype, o0 : nat}: - `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, o0, S_sx, c))]) - -- if ($size($valtype_numtype(nt)) = ?(o0)) + ;; 8-reduction.watsup:199.1-200.60 + rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: + `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) - ;; 8-reduction.watsup:236.1-238.48 - rule cvtop-val {c : c, c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: - `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) - -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = [c]) + ;; 8-reduction.watsup:196.1-197.55 + rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: + `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) - ;; 8-reduction.watsup:240.1-242.50 - rule cvtop-trap {c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: - `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) - -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = []) + ;; 8-reduction.watsup:193.1-194.35 + rule frame-vals {f : frame, n : n, val^n : val^n}: + `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) - ;; 8-reduction.watsup:250.1-251.60 - rule ref.i31 {i : nat}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, i))]) + ;; 8-reduction.watsup:189.1-190.98 + rule return_call_indirect {x : idx, y : idx}: + `%*~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) RETURN_CALL_REF_admininstr(?(y))]) - ;; 8-reduction.watsup:254.1-256.28 - rule ref.is_null-true {ht : heaptype, val : val}: - `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- if (val = REF.NULL_val(ht)) + ;; 8-reduction.watsup:186.1-187.84 + rule call_indirect-call {x : idx, y : idx}: + `%*~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) CALL_REF_admininstr(?(y))]) - ;; 8-reduction.watsup:258.1-260.15 - rule ref.is_null-false {val : val}: - `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) + ;; 8-reduction.watsup:130.1-132.15 + rule br_on_non_null-addr {l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], [$admininstr_val(val) BR_admininstr(l)]) -- otherwise - ;; 8-reduction.watsup:263.1-265.28 - rule ref.as_non_null-null {ht : heaptype, ref : ref}: - `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) - -- if (ref = REF.NULL_ref(ht)) + ;; 8-reduction.watsup:126.1-128.26 + rule br_on_non_null-null {ht : heaptype, l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], []) + -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:267.1-269.15 - rule ref.as_non_null-addr {ref : ref}: - `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [$admininstr_ref(ref)]) + ;; 8-reduction.watsup:121.1-123.15 + rule br_on_null-addr {l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [$admininstr_val(val)]) -- otherwise - ;; 8-reduction.watsup:272.1-274.55 - rule ref.eq-null {ht_1 : heaptype, ht_2 : heaptype, ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) + ;; 8-reduction.watsup:117.1-119.26 + rule br_on_null-null {ht : heaptype, l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) + -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:276.1-279.22 - rule ref.eq-true {ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- otherwise - -- if (ref_1 = ref_2) + ;; 8-reduction.watsup:112.1-114.18 + rule br_table-ge {i : nat, l* : labelidx*, l' : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) + -- if (i >= |l*{l}|) - ;; 8-reduction.watsup:281.1-283.15 - rule ref.eq-false {ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 0)]) - -- otherwise + ;; 8-reduction.watsup:108.1-110.17 + rule br_table-lt {i : nat, l* : labelidx*, l' : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) + -- if (i < |l*{l}|) - ;; 8-reduction.watsup:308.1-309.39 - rule i31.get-null {ht : heaptype, sx : sx}: - `%*~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) + ;; 8-reduction.watsup:103.1-105.14 + rule br_if-false {c : c, l : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) + -- if (c = 0) - ;; 8-reduction.watsup:311.1-312.68 - rule i31.get-num {i : nat, sx : sx}: - `%*~>%*`([REF.I31_NUM_admininstr(i) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, i))]) + ;; 8-reduction.watsup:99.1-101.16 + rule br_if-true {c : c, l : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) + -- if (c =/= 0) - ;; 8-reduction.watsup:529.1-530.58 - rule extern.convert_any-null {ht : heaptype}: - `%*~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) + ;; 8-reduction.watsup:95.1-96.65 + rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) - ;; 8-reduction.watsup:532.1-533.55 - rule extern.convert_any-addr {addrref : addrref}: - `%*~>%*`([$admininstr_addrref(addrref) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) + ;; 8-reduction.watsup:92.1-93.69 + rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) - ;; 8-reduction.watsup:536.1-537.55 - rule any.convert_extern-null {ht : heaptype}: - `%*~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) + ;; 8-reduction.watsup:85.1-86.38 + rule label-vals {instr* : instr*, n : n, val* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) - ;; 8-reduction.watsup:539.1-540.55 - rule any.convert_extern-addr {addrref : addrref}: - `%*~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [$admininstr_addrref(addrref)]) + ;; 8-reduction.watsup:80.1-82.14 + rule if-false {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) + -- if (c = 0) - ;; 8-reduction.watsup:552.1-553.47 - rule local.tee {val : val, x : idx}: - `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) + ;; 8-reduction.watsup:76.1-78.16 + rule if-true {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) + -- if (c =/= 0) + + ;; 8-reduction.watsup:56.1-58.14 + rule select-false {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: + `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_2)]) + -- if (c = 0) + + ;; 8-reduction.watsup:52.1-54.16 + rule select-true {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: + `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_1)]) + -- if (c =/= 0) + + ;; 8-reduction.watsup:48.1-49.20 + rule drop {val : val}: + `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) + + ;; 8-reduction.watsup:45.1-46.15 + rule nop: + `%*~>%*`([NOP_admininstr], []) + + ;; 8-reduction.watsup:42.1-43.24 + rule unreachable: + `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) ;; 8-reduction.watsup:63.1-63.73 def blocktype : (state, blocktype) -> functype - ;; 8-reduction.watsup:64.1-64.44 - def {z : state} blocktype(z, _RESULT_blocktype(?())) = `%->%`([], []) - ;; 8-reduction.watsup:65.1-65.40 - def {t : valtype, z : state} blocktype(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) ;; 8-reduction.watsup:66.1-66.66 def {ft : functype, x : idx, z : state} blocktype(z, _IDX_blocktype(x)) = ft -- Expand: `%~~%`($type(z, x), FUNC_comptype(ft)) + ;; 8-reduction.watsup:65.1-65.40 + def {t : valtype, z : state} blocktype(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) + ;; 8-reduction.watsup:64.1-64.44 + def {z : state} blocktype(z, _RESULT_blocktype(?())) = `%->%`([], []) ;; 8-reduction.watsup:7.1-7.63 relation Step_read: `%~>%*`(config, admininstr*) - ;; 8-reduction.watsup:68.1-70.43 - rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + ;; 8-reduction.watsup:753.1-757.15 + rule memory.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, y).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x, y)]) + -- otherwise - ;; 8-reduction.watsup:72.1-74.43 - rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + ;; 8-reduction.watsup:748.1-751.14 + rule memory.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:135.1-138.66 - rule br_on_cast-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt) - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) + ;; 8-reduction.watsup:744.1-746.70 + rule memory.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) - ;; 8-reduction.watsup:140.1-142.15 - rule br_on_cast-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) + ;; 8-reduction.watsup:737.1-741.15 + rule memory.copy-gt {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise - ;; 8-reduction.watsup:145.1-148.66 - rule br_on_cast_fail-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt) - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) + ;; 8-reduction.watsup:730.1-735.19 + rule memory.copy-le {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, (i_1 + 1)) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) + -- otherwise + -- if (i_1 <= i_2) - ;; 8-reduction.watsup:150.1-152.15 - rule br_on_cast_fail-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) + ;; 8-reduction.watsup:725.1-728.14 + rule memory.copy-zero {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), []) -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:157.1-158.62 - rule call {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) CALL_REF_admininstr(?())]) + ;; 8-reduction.watsup:721.1-723.77 + rule memory.copy-oob {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) - ;; 8-reduction.watsup:160.1-161.43 - rule call_ref-null {ht : heaptype, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) + ;; 8-reduction.watsup:714.1-718.15 + rule memory.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr(x)]) + -- otherwise - ;; 8-reduction.watsup:163.1-168.59 - rule call_ref-func {a : addr, f : frame, fi : funcinst, instr* : instr*, m : m, n : n, t* : valtype*, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, x? : idx?, y : idx, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], $admininstr_instr(instr)*{instr})])]) - -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) - -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) + ;; 8-reduction.watsup:709.1-712.14 + rule memory.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:171.1-172.76 - rule return_call {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) RETURN_CALL_REF_admininstr(?())]) + ;; 8-reduction.watsup:705.1-707.37 + rule memory.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:175.1-176.78 - rule return_call_ref-frame-null {f : frame, ht : heaptype, instr* : instr*, k : nat, val* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), [TRAP_admininstr]) + ;; 8-reduction.watsup:692.1-694.44 + rule memory.size {n : n, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) + -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:178.1-180.59 - rule return_call_ref-frame-addr {a : addr, f : frame, instr* : instr*, k : nat, m : m, n : n, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, val'* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + ;; 8-reduction.watsup:670.1-672.61 + rule load-pack-val {c : c, i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state, o0 : nat}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [CONST_admininstr(nt, $ext(n, o0, sx, c))]) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) - ;; 8-reduction.watsup:182.1-183.91 - rule return_call_ref-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) + ;; 8-reduction.watsup:666.1-668.51 + rule load-pack-oob {i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [TRAP_admininstr]) + -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:247.1-248.55 - rule ref.func {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) + ;; 8-reduction.watsup:662.1-664.71 + rule load-num-val {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (o0 / 8)]) - ;; 8-reduction.watsup:286.1-289.65 - rule ref.test-true {ref : ref, rt : reftype, rt' : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 1)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt') - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) + ;; 8-reduction.watsup:658.1-660.59 + rule load-num-oob {i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if (((i + mo.OFFSET_memop) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:291.1-293.15 - rule ref.test-false {ref : ref, rt : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 0)]) + ;; 8-reduction.watsup:645.1-649.15 + rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.INIT_admininstr(x, y)]) -- otherwise - ;; 8-reduction.watsup:296.1-299.65 - rule ref.cast-succeed {ref : ref, rt : reftype, rt' : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [$admininstr_ref(ref)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt') - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) - - ;; 8-reduction.watsup:301.1-303.15 - rule ref.cast-fail {ref : ref, rt : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:640.1-643.14 + rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), []) -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:322.1-325.43 - rule struct.new_default {mut* : mut*, val* : val*, x : idx, z : state, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)*{val} :: [STRUCT.NEW_admininstr(x)]) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} + ;; 8-reduction.watsup:636.1-638.72 + rule table.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) - ;; 8-reduction.watsup:328.1-329.50 - rule struct.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:629.1-633.15 + rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) + -- otherwise - ;; 8-reduction.watsup:331.1-334.41 - rule struct.get-struct {a : addr, i : nat, mut* : mut*, si : structinst, sx? : sx?, x : idx, z : state, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [$admininstr_val($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]))]) - -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + ;; 8-reduction.watsup:622.1-627.15 + rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) + -- otherwise + -- if (j <= i) - ;; 8-reduction.watsup:348.1-349.70 - rule array.new {n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.NEW_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + ;; 8-reduction.watsup:617.1-620.14 + rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:351.1-354.40 - rule array.new_default {mut : mut, n : n, val : val, x : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) ARRAY.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ($default($unpacktype(zt)) = ?(val)) + ;; 8-reduction.watsup:613.1-615.73 + rule table.copy-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) - ;; 8-reduction.watsup:362.1-364.38 - rule array.new_elem-oob {i : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) + ;; 8-reduction.watsup:606.1-610.15 + rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) + -- otherwise - ;; 8-reduction.watsup:366.1-368.40 - rule array.new_elem-alloc {i : nat, n : n, ref^n : ref^n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), $admininstr_ref(ref)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) + ;; 8-reduction.watsup:601.1-604.14 + rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:371.1-374.59 - rule array.new_data-oob {i : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) + ;; 8-reduction.watsup:597.1-599.39 + rule table.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:376.1-380.88 - rule array.new_data-alloc {c^n : c^n, i : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (nt = $unpacknumtype(zt)) - -- if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) + ;; 8-reduction.watsup:584.1-586.32 + rule table.size {n : n, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) + -- if (|$table(z, x).ELEM_tableinst| = n) - ;; 8-reduction.watsup:383.1-384.61 - rule array.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:571.1-573.32 + rule table.get-val {i : nat, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) + -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:386.1-388.38 - rule array.get-oob {a : addr, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) - -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:567.1-569.33 + rule table.get-oob {i : nat, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) + -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:390.1-393.53 - rule array.get-array {a : addr, fv : fieldval, i : nat, mut : mut, sx? : sx?, x : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [$admininstr_val($unpackval(zt, sx?{sx}, fv))]) - -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) - -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) + ;; 8-reduction.watsup:558.1-559.45 + rule global.get {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) - ;; 8-reduction.watsup:409.1-410.39 - rule array.len-null {ht : heaptype, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) + ;; 8-reduction.watsup:545.1-547.27 + rule local.get {val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val(val)]) + -- if ($local(z, x) = ?(val)) - ;; 8-reduction.watsup:412.1-414.37 - rule array.len-array {a : addr, n : n, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, n)]) - -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:517.1-524.67 + rule array.init_data-succ {a : addr, c : c, i : nat, j : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + ($storagesize(zt) / 8))) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_DATA_admininstr(x, y)]) + -- otherwise + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (nt = $unpacknumtype(zt)) + -- if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) - ;; 8-reduction.watsup:417.1-418.76 - rule array.fill-null {ht : heaptype, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:512.1-515.14 + rule array.init_data-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:420.1-422.44 - rule array.fill-oob {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:507.1-510.59 + rule array.init_data-oob2 {a : addr, i : nat, j : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) + + ;; 8-reduction.watsup:503.1-505.44 + rule array.init_data-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:424.1-427.14 - rule array.fill-zero {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:500.1-501.93 + rule array.init_data-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:429.1-433.15 - rule array.fill-succ {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.FILL_admininstr(x)]) + ;; 8-reduction.watsup:492.1-497.34 + rule array.init_elem-succ {a : addr, i : nat, j : nat, n : n, ref : ref, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_ELEM_admininstr(x, y)]) -- otherwise + -- if (ref = $elem(z, y).ELEM_eleminst[j]) - ;; 8-reduction.watsup:435.1-436.102 - rule array.copy-null1 {ht_1 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, i_1) $admininstr_ref(ref) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:487.1-490.14 + rule array.init_elem-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:438.1-439.102 - rule array.copy-null2 {ht_2 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, i_1) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:483.1-485.38 + rule array.init_elem-oob2 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) - ;; 8-reduction.watsup:441.1-443.48 - rule array.copy-oob1 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) + ;; 8-reduction.watsup:479.1-481.44 + rule array.init_elem-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:445.1-447.48 - rule array.copy-oob2 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) + ;; 8-reduction.watsup:476.1-477.93 + rule array.init_elem-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:449.1-452.14 - rule array.copy-zero {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), []) + ;; 8-reduction.watsup:465.1-473.29 + rule array.copy-gt {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise - -- if (n = 0) + -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) + -- if (sx?{sx} = $sxfield(zt_2)) ;; 8-reduction.watsup:454.1-463.19 rule array.copy-le {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: @@ -15850,360 +16007,346 @@ relation Step_read: `%~>%*`(config, admininstr*) -- if (sx?{sx} = $sxfield(zt_2)) -- if (i_1 <= i_2) - ;; 8-reduction.watsup:465.1-473.29 - rule array.copy-gt {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) + ;; 8-reduction.watsup:449.1-452.14 + rule array.copy-zero {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), []) -- otherwise - -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (n = 0) - ;; 8-reduction.watsup:476.1-477.93 - rule array.init_elem-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:445.1-447.48 + rule array.copy-oob2 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) - ;; 8-reduction.watsup:479.1-481.44 - rule array.init_elem-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:441.1-443.48 + rule array.copy-oob1 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) - ;; 8-reduction.watsup:483.1-485.38 - rule array.init_elem-oob2 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) + ;; 8-reduction.watsup:438.1-439.102 + rule array.copy-null2 {ht_2 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, i_1) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:487.1-490.14 - rule array.init_elem-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:435.1-436.102 + rule array.copy-null1 {ht_1 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, i_1) $admininstr_ref(ref) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:492.1-497.34 - rule array.init_elem-succ {a : addr, i : nat, j : nat, n : n, ref : ref, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_ELEM_admininstr(x, y)]) + ;; 8-reduction.watsup:429.1-433.15 + rule array.fill-succ {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.FILL_admininstr(x)]) -- otherwise - -- if (ref = $elem(z, y).ELEM_eleminst[j]) - - ;; 8-reduction.watsup:500.1-501.93 - rule array.init_data-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - - ;; 8-reduction.watsup:503.1-505.44 - rule array.init_data-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - - ;; 8-reduction.watsup:507.1-510.59 - rule array.init_data-oob2 {a : addr, i : nat, j : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) - ;; 8-reduction.watsup:512.1-515.14 - rule array.init_data-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), []) + ;; 8-reduction.watsup:424.1-427.14 + rule array.fill-zero {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 8-reduction.watsup:517.1-524.67 - rule array.init_data-succ {a : addr, c : c, i : nat, j : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + ($storagesize(zt) / 8))) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_DATA_admininstr(x, y)]) - -- otherwise - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (nt = $unpacknumtype(zt)) - -- if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) + ;; 8-reduction.watsup:420.1-422.44 + rule array.fill-oob {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:545.1-547.27 - rule local.get {val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val(val)]) - -- if ($local(z, x) = ?(val)) + ;; 8-reduction.watsup:417.1-418.76 + rule array.fill-null {ht : heaptype, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:558.1-559.45 - rule global.get {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) + ;; 8-reduction.watsup:412.1-414.37 + rule array.len-array {a : addr, n : n, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, n)]) + -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:567.1-569.33 - rule table.get-oob {i : nat, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) - -- if (i >= |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:409.1-410.39 + rule array.len-null {ht : heaptype, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) - ;; 8-reduction.watsup:571.1-573.32 - rule table.get-val {i : nat, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) - -- if (i < |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:390.1-393.53 + rule array.get-array {a : addr, fv : fieldval, i : nat, mut : mut, sx? : sx?, x : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [$admininstr_val($unpackval(zt, sx?{sx}, fv))]) + -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) + -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) - ;; 8-reduction.watsup:584.1-586.32 - rule table.size {n : n, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) - -- if (|$table(z, x).ELEM_tableinst| = n) + ;; 8-reduction.watsup:386.1-388.38 + rule array.get-oob {a : addr, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:597.1-599.39 - rule table.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:383.1-384.61 + rule array.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:601.1-604.14 - rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:376.1-380.88 + rule array.new_data-alloc {c^n : c^n, i : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (nt = $unpacknumtype(zt)) + -- if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) - ;; 8-reduction.watsup:606.1-610.15 - rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) - -- otherwise + ;; 8-reduction.watsup:371.1-374.59 + rule array.new_data-oob {i : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) - ;; 8-reduction.watsup:613.1-615.73 - rule table.copy-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) + ;; 8-reduction.watsup:366.1-368.40 + rule array.new_elem-alloc {i : nat, n : n, ref^n : ref^n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), $admininstr_ref(ref)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) - ;; 8-reduction.watsup:617.1-620.14 - rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:362.1-364.38 + rule array.new_elem-oob {i : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) - ;; 8-reduction.watsup:622.1-627.15 - rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) - -- otherwise - -- if (j <= i) + ;; 8-reduction.watsup:351.1-354.40 + rule array.new_default {mut : mut, n : n, val : val, x : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) ARRAY.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ($default($unpacktype(zt)) = ?(val)) - ;; 8-reduction.watsup:629.1-633.15 - rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) - -- otherwise + ;; 8-reduction.watsup:348.1-349.70 + rule array.new {n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.NEW_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - ;; 8-reduction.watsup:636.1-638.72 - rule table.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) + ;; 8-reduction.watsup:331.1-334.41 + rule struct.get-struct {a : addr, i : nat, mut* : mut*, si : structinst, sx? : sx?, x : idx, z : state, zt* : storagetype*}: + `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [$admininstr_val($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]))]) + -- if ($structinst(z)[a] = si) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - ;; 8-reduction.watsup:640.1-643.14 - rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), []) + ;; 8-reduction.watsup:328.1-329.50 + rule struct.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [TRAP_admininstr]) + + ;; 8-reduction.watsup:322.1-325.43 + rule struct.new_default {mut* : mut*, val* : val*, x : idx, z : state, zt* : storagetype*}: + `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)*{val} :: [STRUCT.NEW_admininstr(x)]) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} + + ;; 8-reduction.watsup:301.1-303.15 + rule ref.cast-fail {ref : ref, rt : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) -- otherwise - -- if (n = 0) - ;; 8-reduction.watsup:645.1-649.15 - rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.INIT_admininstr(x, y)]) + ;; 8-reduction.watsup:296.1-299.65 + rule ref.cast-succeed {ref : ref, rt : reftype, rt' : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [$admininstr_ref(ref)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt') + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) + + ;; 8-reduction.watsup:291.1-293.15 + rule ref.test-false {ref : ref, rt : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 8-reduction.watsup:658.1-660.59 - rule load-num-oob {i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if (((i + mo.OFFSET_memop) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:286.1-289.65 + rule ref.test-true {ref : ref, rt : reftype, rt' : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 1)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt') + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) - ;; 8-reduction.watsup:662.1-664.71 - rule load-num-val {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (o0 / 8)]) + ;; 8-reduction.watsup:247.1-248.55 + rule ref.func {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) - ;; 8-reduction.watsup:666.1-668.51 - rule load-pack-oob {i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [TRAP_admininstr]) - -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:182.1-183.91 + rule return_call_ref-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) - ;; 8-reduction.watsup:670.1-672.61 - rule load-pack-val {c : c, i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [CONST_admininstr(nt, $ext(n, o0, sx, c))]) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) + ;; 8-reduction.watsup:178.1-180.59 + rule return_call_ref-frame-addr {a : addr, f : frame, instr* : instr*, k : nat, m : m, n : n, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, val'* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - ;; 8-reduction.watsup:692.1-694.44 - rule memory.size {n : n, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) - -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:175.1-176.78 + rule return_call_ref-frame-null {f : frame, ht : heaptype, instr* : instr*, k : nat, val* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), [TRAP_admininstr]) - ;; 8-reduction.watsup:705.1-707.37 - rule memory.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:171.1-172.76 + rule return_call {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) RETURN_CALL_REF_admininstr(?())]) - ;; 8-reduction.watsup:709.1-712.14 - rule memory.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:163.1-168.59 + rule call_ref-func {a : addr, f : frame, fi : funcinst, instr* : instr*, m : m, n : n, t* : valtype*, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, x? : idx?, y : idx, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], $admininstr_instr(instr)*{instr})])]) + -- if ($funcinst(z)[a] = fi) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) + -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) - ;; 8-reduction.watsup:714.1-718.15 - rule memory.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr(x)]) - -- otherwise + ;; 8-reduction.watsup:160.1-161.43 + rule call_ref-null {ht : heaptype, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) - ;; 8-reduction.watsup:721.1-723.77 - rule memory.copy-oob {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) + ;; 8-reduction.watsup:157.1-158.62 + rule call {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) CALL_REF_admininstr(?())]) - ;; 8-reduction.watsup:725.1-728.14 - rule memory.copy-zero {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), []) + ;; 8-reduction.watsup:150.1-152.15 + rule br_on_cast_fail-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) -- otherwise - -- if (n = 0) - ;; 8-reduction.watsup:730.1-735.19 - rule memory.copy-le {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, (i_1 + 1)) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) - -- otherwise - -- if (i_1 <= i_2) + ;; 8-reduction.watsup:145.1-148.66 + rule br_on_cast_fail-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt) + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) - ;; 8-reduction.watsup:737.1-741.15 - rule memory.copy-gt {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) + ;; 8-reduction.watsup:140.1-142.15 + rule br_on_cast-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) -- otherwise - ;; 8-reduction.watsup:744.1-746.70 - rule memory.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) + ;; 8-reduction.watsup:135.1-138.66 + rule br_on_cast-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt) + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) - ;; 8-reduction.watsup:748.1-751.14 - rule memory.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:72.1-74.43 + rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 8-reduction.watsup:753.1-757.15 - rule memory.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, y).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x, y)]) - -- otherwise + ;; 8-reduction.watsup:68.1-70.43 + rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) ;; 8-reduction.watsup:5.1-5.63 relation Step: `%~>%`(config, config) - ;; 8-reduction.watsup:10.1-12.34 - rule pure {instr* : instr*, instr'* : instr*, z : state}: - `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) - -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) + ;; 8-reduction.watsup:760.1-761.51 + rule data.drop {x : idx, z : state}: + `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) - ;; 8-reduction.watsup:14.1-16.37 - rule read {instr* : instr*, instr'* : instr*, z : state}: - `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) - -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) + ;; 8-reduction.watsup:701.1-702.77 + rule memory.grow-fail {n : n, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) - ;; 8-reduction.watsup:317.1-320.61 - rule struct.new {mut^n : mut^n, n : n, si : structinst, val^n : val^n, x : idx, z : state, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) - -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) + ;; 8-reduction.watsup:697.1-699.40 + rule memory.grow-succeed {mi : meminst, n : n, x : idx, z : state, o0 : meminst}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, (|$mem(z, x).DATA_meminst| / (64 * $Ki)))])) + -- if ($growmemory($mem(z, x), n) = ?(o0)) + -- if (mi = o0) - ;; 8-reduction.watsup:337.1-338.53 - rule struct.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`(z, [TRAP_admininstr])) + ;; 8-reduction.watsup:687.1-689.48 + rule store-pack-val {b* : byte*, c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (n / 8), b*{b}), [])) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if (b*{b} = $ibytes(n, $wrap(o0, n, c))) - ;; 8-reduction.watsup:340.1-343.35 - rule struct.set-struct {a : addr, fv : fieldval, i : nat, mut* : mut*, val : val, x : idx, z : state, zt* : storagetype*}: - `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`($with_struct(z, a, i, fv), [])) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + ;; 8-reduction.watsup:683.1-685.51 + rule store-pack-oob {c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:356.1-359.61 - rule array.new_fixed {ai : arrayinst, mut : mut, n : n, val^n : val^n, x : idx, z : state, zt : storagetype}: - `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) + ;; 8-reduction.watsup:679.1-681.29 + rule store-num-val {b* : byte*, c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (o0 / 8), b*{b}), [])) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if (b*{b} = $ntbytes(nt, c)) - ;; 8-reduction.watsup:396.1-397.64 - rule array.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + ;; 8-reduction.watsup:675.1-677.59 + rule store-num-oob {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if (((i + mo.OFFSET_memop) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:399.1-401.38 - rule array.set-oob {a : addr, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) - -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:652.1-653.51 + rule elem.drop {x : idx, z : state}: + `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) - ;; 8-reduction.watsup:403.1-406.31 - rule array.set-array {a : addr, fv : fieldval, i : nat, mut : mut, val : val, x : idx, z : state, zt : storagetype}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) - -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) - -- if (fv = $packval(zt, val)) + ;; 8-reduction.watsup:593.1-594.80 + rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) - ;; 8-reduction.watsup:549.1-550.56 - rule local.set {val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) + ;; 8-reduction.watsup:589.1-591.46 + rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state, o0 : tableinst}: + `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) + -- if ($growtable($table(z, x), n, ref) = ?(o0)) + -- if (ti = o0) - ;; 8-reduction.watsup:561.1-562.58 - rule global.set {val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) + ;; 8-reduction.watsup:579.1-581.32 + rule table.set-val {i : nat, ref : ref, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) + -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup:575.1-577.33 rule table.set-oob {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:579.1-581.32 - rule table.set-val {i : nat, ref : ref, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) - -- if (i < |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:561.1-562.58 + rule global.set {val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) - ;; 8-reduction.watsup:589.1-591.46 - rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state, o0 : tableinst}: - `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) - -- if ($growtable($table(z, x), n, ref) = ?(o0)) - -- if (ti = o0) + ;; 8-reduction.watsup:549.1-550.56 + rule local.set {val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) - ;; 8-reduction.watsup:593.1-594.80 - rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) + ;; 8-reduction.watsup:403.1-406.31 + rule array.set-array {a : addr, fv : fieldval, i : nat, mut : mut, val : val, x : idx, z : state, zt : storagetype}: + `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) + -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) + -- if (fv = $packval(zt, val)) - ;; 8-reduction.watsup:652.1-653.51 - rule elem.drop {x : idx, z : state}: - `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) + ;; 8-reduction.watsup:399.1-401.38 + rule array.set-oob {a : addr, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:675.1-677.59 - rule store-num-oob {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if (((i + mo.OFFSET_memop) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:396.1-397.64 + rule array.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) - ;; 8-reduction.watsup:679.1-681.29 - rule store-num-val {b* : byte*, c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (o0 / 8), b*{b}), [])) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if (b*{b} = $ntbytes(nt, c)) + ;; 8-reduction.watsup:356.1-359.61 + rule array.new_fixed {ai : arrayinst, mut : mut, n : n, val^n : val^n, x : idx, z : state, zt : storagetype}: + `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) - ;; 8-reduction.watsup:683.1-685.51 - rule store-pack-oob {c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:340.1-343.35 + rule struct.set-struct {a : addr, fv : fieldval, i : nat, mut* : mut*, val : val, x : idx, z : state, zt* : storagetype*}: + `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`($with_struct(z, a, i, fv), [])) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- if (fv = $packval(zt*{zt}[i], val)) - ;; 8-reduction.watsup:687.1-689.48 - rule store-pack-val {b* : byte*, c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (n / 8), b*{b}), [])) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if (b*{b} = $ibytes(n, $wrap(o0, n, c))) + ;; 8-reduction.watsup:337.1-338.53 + rule struct.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`(z, [TRAP_admininstr])) - ;; 8-reduction.watsup:697.1-699.40 - rule memory.grow-succeed {mi : meminst, n : n, x : idx, z : state, o0 : meminst}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, (|$mem(z, x).DATA_meminst| / (64 * $Ki)))])) - -- if ($growmemory($mem(z, x), n) = ?(o0)) - -- if (mi = o0) + ;; 8-reduction.watsup:317.1-320.61 + rule struct.new {mut^n : mut^n, n : n, si : structinst, val^n : val^n, x : idx, z : state, zt^n : storagetype^n}: + `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) + -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) - ;; 8-reduction.watsup:701.1-702.77 - rule memory.grow-fail {n : n, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) + ;; 8-reduction.watsup:14.1-16.37 + rule read {instr* : instr*, instr'* : instr*, z : state}: + `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) + -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) - ;; 8-reduction.watsup:760.1-761.51 - rule data.drop {x : idx, z : state}: - `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) + ;; 8-reduction.watsup:10.1-12.34 + rule pure {instr* : instr*, instr'* : instr*, z : state}: + `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) + -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) ;; 8-reduction.watsup:8.1-8.63 rec { ;; 8-reduction.watsup:8.1-8.63 relation Steps: `%~>*%`(config, config) - ;; 8-reduction.watsup:18.1-19.36 - rule refl {admininstr* : admininstr*, z : state}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) - ;; 8-reduction.watsup:21.1-24.53 rule trans {admininstr* : admininstr*, admininstr' : admininstr, admininstr''* : admininstr*, z : state, z' : state, z'' : state}: `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z'', admininstr''*{admininstr''})) -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z', admininstr'*{})) -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr''})) + + ;; 8-reduction.watsup:18.1-19.36 + rule refl {admininstr* : admininstr*, z : state}: + `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) } ;; 8-reduction.watsup:29.1-29.69 @@ -16218,14 +16361,14 @@ rec { ;; 9-module.watsup:7.1-7.34 def alloctypes : type* -> deftype* - ;; 9-module.watsup:8.1-8.27 - def alloctypes([]) = [] ;; 9-module.watsup:9.1-13.24 def {deftype* : deftype*, deftype'* : deftype*, rectype : rectype, type : type, type'* : type*, x : idx} alloctypes(type'*{type'} :: [type]) = deftype'*{deftype'} :: deftype*{deftype} -- if (deftype'*{deftype'} = $alloctypes(type'*{type'})) -- if (type = TYPE(rectype)) -- if (deftype*{deftype} = $subst_all_deftypes($rolldt(x, rectype), $heaptype_deftype(deftype')*{deftype'})) -- if (x = |deftype'*{deftype'}|) + ;; 9-module.watsup:8.1-8.27 + def alloctypes([]) = [] } ;; 9-module.watsup:15.1-15.60 @@ -16240,12 +16383,12 @@ rec { ;; 9-module.watsup:20.1-20.63 def allocfuncs : (store, moduleinst, func*) -> (store, funcaddr*) - ;; 9-module.watsup:21.1-21.39 - def {mm : moduleinst, s : store} allocfuncs(s, mm, []) = (s, []) ;; 9-module.watsup:22.1-24.51 def {fa : funcaddr, fa'* : funcaddr*, func : func, func'* : func*, mm : moduleinst, s : store, s_1 : store, s_2 : store} allocfuncs(s, mm, [func] :: func'*{func'}) = (s_2, [fa] :: fa'*{fa'}) -- if ((s_1, fa) = $allocfunc(s, mm, func)) -- if ((s_2, fa'*{fa'}) = $allocfuncs(s_1, mm, func'*{func'})) + ;; 9-module.watsup:21.1-21.39 + def {mm : moduleinst, s : store} allocfuncs(s, mm, []) = (s, []) } ;; 9-module.watsup:26.1-26.63 @@ -16259,12 +16402,12 @@ rec { ;; 9-module.watsup:30.1-30.67 def allocglobals : (store, globaltype*, val*) -> (store, globaladdr*) - ;; 9-module.watsup:31.1-31.42 - def {s : store} allocglobals(s, [], []) = (s, []) ;; 9-module.watsup:32.1-34.62 def {ga : globaladdr, ga'* : globaladdr*, globaltype : globaltype, globaltype'* : globaltype*, s : store, s_1 : store, s_2 : store, val : val, val'* : val*} allocglobals(s, [globaltype] :: globaltype'*{globaltype'}, [val] :: val'*{val'}) = (s_2, [ga] :: ga'*{ga'}) -- if ((s_1, ga) = $allocglobal(s, globaltype, val)) -- if ((s_2, ga'*{ga'}) = $allocglobals(s_1, globaltype'*{globaltype'}, val'*{val'})) + ;; 9-module.watsup:31.1-31.42 + def {s : store} allocglobals(s, [], []) = (s, []) } ;; 9-module.watsup:36.1-36.60 @@ -16278,12 +16421,12 @@ rec { ;; 9-module.watsup:40.1-40.64 def alloctables : (store, tabletype*, ref*) -> (store, tableaddr*) - ;; 9-module.watsup:41.1-41.41 - def {s : store} alloctables(s, [], []) = (s, []) ;; 9-module.watsup:42.1-44.60 def {ref : ref, ref'* : ref*, s : store, s_1 : store, s_2 : store, ta : tableaddr, ta'* : tableaddr*, tabletype : tabletype, tabletype'* : tabletype*} alloctables(s, [tabletype] :: tabletype'*{tabletype'}, [ref] :: ref'*{ref'}) = (s_2, [ta] :: ta'*{ta'}) -- if ((s_1, ta) = $alloctable(s, tabletype, ref)) -- if ((s_2, ta'*{ta'}) = $alloctables(s_1, tabletype'*{tabletype'}, ref'*{ref'})) + ;; 9-module.watsup:41.1-41.41 + def {s : store} alloctables(s, [], []) = (s, []) } ;; 9-module.watsup:46.1-46.49 @@ -16297,12 +16440,12 @@ rec { ;; 9-module.watsup:50.1-50.52 def allocmems : (store, memtype*) -> (store, memaddr*) - ;; 9-module.watsup:51.1-51.34 - def {s : store} allocmems(s, []) = (s, []) ;; 9-module.watsup:52.1-54.49 def {ma : memaddr, ma'* : memaddr*, memtype : memtype, memtype'* : memtype*, s : store, s_1 : store, s_2 : store} allocmems(s, [memtype] :: memtype'*{memtype'}) = (s_2, [ma] :: ma'*{ma'}) -- if ((s_1, ma) = $allocmem(s, memtype)) -- if ((s_2, ma'*{ma'}) = $allocmems(s_1, memtype'*{memtype'})) + ;; 9-module.watsup:51.1-51.34 + def {s : store} allocmems(s, []) = (s, []) } ;; 9-module.watsup:56.1-56.57 @@ -16316,12 +16459,12 @@ rec { ;; 9-module.watsup:60.1-60.63 def allocelems : (store, reftype*, ref**) -> (store, elemaddr*) - ;; 9-module.watsup:61.1-61.40 - def {s : store} allocelems(s, [], []) = (s, []) ;; 9-module.watsup:62.1-64.55 def {ea : elemaddr, ea'* : elemaddr*, ref* : ref*, ref'** : ref**, rt : reftype, rt'* : reftype*, s : store, s_1 : store, s_2 : store} allocelems(s, [rt] :: rt'*{rt'}, [ref*{ref}] :: ref'*{ref'}*{ref'}) = (s_2, [ea] :: ea'*{ea'}) -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref})) -- if ((s_2, ea'*{ea'}) = $allocelems(s_2, rt'*{rt'}, ref'*{ref'}*{ref'})) + ;; 9-module.watsup:61.1-61.40 + def {s : store} allocelems(s, [], []) = (s, []) } ;; 9-module.watsup:66.1-66.49 @@ -16335,24 +16478,24 @@ rec { ;; 9-module.watsup:70.1-70.54 def allocdatas : (store, byte**) -> (store, dataaddr*) - ;; 9-module.watsup:71.1-71.35 - def {s : store} allocdatas(s, []) = (s, []) ;; 9-module.watsup:72.1-74.50 def {byte* : byte*, byte'** : byte**, da : dataaddr, da'* : dataaddr*, s : store, s_1 : store, s_2 : store} allocdatas(s, [byte*{byte}] :: byte'*{byte'}*{byte'}) = (s_2, [da] :: da'*{da'}) -- if ((s_1, da) = $allocdata(s, byte*{byte})) -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) + ;; 9-module.watsup:71.1-71.35 + def {s : store} allocdatas(s, []) = (s, []) } ;; 9-module.watsup:79.1-79.83 def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst - ;; 9-module.watsup:80.1-80.95 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} - ;; 9-module.watsup:81.1-81.99 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} - ;; 9-module.watsup:82.1-82.97 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} ;; 9-module.watsup:83.1-83.93 def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} + ;; 9-module.watsup:82.1-82.97 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} + ;; 9-module.watsup:81.1-81.99 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} + ;; 9-module.watsup:80.1-80.95 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} ;; 9-module.watsup:86.1-86.87 def allocmodule : (store, module, externval*, val*, ref*, ref**) -> (store, moduleinst) @@ -16384,27 +16527,27 @@ rec { ;; 9-module.watsup:134.1-134.38 def concat_instr : instr** -> instr* - ;; 9-module.watsup:135.1-135.29 - def concat_instr([]) = [] ;; 9-module.watsup:136.1-136.74 def {instr* : instr*, instr'** : instr**} concat_instr([instr*{instr}] :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) + ;; 9-module.watsup:135.1-135.29 + def concat_instr([]) = [] } ;; 9-module.watsup:138.1-138.33 def runelem : (elem, idx) -> instr* - ;; 9-module.watsup:139.1-139.52 - def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, PASSIVE_elemmode), y) = [] - ;; 9-module.watsup:140.1-140.62 - def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] ;; 9-module.watsup:141.1-142.77 def {expr* : expr*, instr* : instr*, reftype : reftype, x : idx, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, ACTIVE_elemmode(x, instr*{instr})), y) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, |expr*{expr}|) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] + ;; 9-module.watsup:140.1-140.62 + def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] + ;; 9-module.watsup:139.1-139.52 + def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, PASSIVE_elemmode), y) = [] ;; 9-module.watsup:144.1-144.33 def rundata : (data, idx) -> instr* - ;; 9-module.watsup:145.1-145.44 - def {byte* : byte*, y : idx} rundata(`DATA%*%`(byte*{byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup:146.1-147.78 def {byte* : byte*, instr* : instr*, x : idx, y : idx} rundata(`DATA%*%`(byte*{byte}, ACTIVE_datamode(x, instr*{instr})), y) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, |byte*{byte}|) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] + ;; 9-module.watsup:145.1-145.44 + def {byte* : byte*, y : idx} rundata(`DATA%*%`(byte*{byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup:149.1-149.53 def instantiate : (store, module, externval*) -> config @@ -16441,20 +16584,20 @@ rec { ;; A-binary.watsup:47.1-47.24 def utf8 : name -> byte* - ;; A-binary.watsup:48.1-48.44 - def {b : byte, c : c} utf8([c]) = [b] - -- if ((c < 128) /\ (c = b)) - ;; A-binary.watsup:49.1-49.93 - def {b_1 : byte, b_2 : byte, c : c} utf8([c]) = [b_1 b_2] - -- if (((128 <= c) /\ (c < 2048)) /\ (c = (((2 ^ 6) * (b_1 - 192)) + (b_2 - 128)))) - ;; A-binary.watsup:50.1-50.144 - def {b_1 : byte, b_2 : byte, b_3 : byte, c : c} utf8([c]) = [b_1 b_2 b_3] - -- if ((((2048 <= c) /\ (c < 55296)) \/ ((57344 <= c) /\ (c < 65536))) /\ (c = ((((2 ^ 12) * (b_1 - 224)) + ((2 ^ 6) * (b_2 - 128))) + (b_3 - 128)))) + ;; A-binary.watsup:52.1-52.41 + def {c* : c*} utf8(c*{c}) = $concat_bytes($utf8([c])*{c}) ;; A-binary.watsup:51.1-51.145 def {b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte, c : c} utf8([c]) = [b_1 b_2 b_3 b_4] -- if (((65536 <= c) /\ (c < 69632)) /\ (c = (((((2 ^ 18) * (b_1 - 240)) + ((2 ^ 12) * (b_2 - 128))) + ((2 ^ 6) * (b_3 - 128))) + (b_4 - 128)))) - ;; A-binary.watsup:52.1-52.41 - def {c* : c*} utf8(c*{c}) = $concat_bytes($utf8([c])*{c}) + ;; A-binary.watsup:50.1-50.144 + def {b_1 : byte, b_2 : byte, b_3 : byte, c : c} utf8([c]) = [b_1 b_2 b_3] + -- if ((((2048 <= c) /\ (c < 55296)) \/ ((57344 <= c) /\ (c < 65536))) /\ (c = ((((2 ^ 12) * (b_1 - 224)) + ((2 ^ 6) * (b_2 - 128))) + (b_3 - 128)))) + ;; A-binary.watsup:49.1-49.93 + def {b_1 : byte, b_2 : byte, c : c} utf8([c]) = [b_1 b_2] + -- if (((128 <= c) /\ (c < 2048)) /\ (c = (((2 ^ 6) * (b_1 - 192)) + (b_2 - 128)))) + ;; A-binary.watsup:48.1-48.44 + def {b : byte, c : c} utf8([c]) = [b] + -- if ((c < 128) /\ (c = b)) } ;; A-binary.watsup:210.1-210.27 @@ -16468,10 +16611,10 @@ rec { ;; A-binary.watsup:665.1-665.62 def concat_locals : local** -> local* - ;; A-binary.watsup:666.1-666.30 - def concat_locals([]) = [] ;; A-binary.watsup:667.1-667.68 def {loc* : local*, loc'** : local**} concat_locals([loc*{loc}] :: loc'*{loc'}*{loc'}) = loc*{loc} :: $concat_locals(loc'*{loc'}*{loc'}) + ;; A-binary.watsup:666.1-666.30 + def concat_locals([]) = [] } ;; A-binary.watsup:670.1-670.29 @@ -16502,12 +16645,12 @@ rec { ;; 0-aux.watsup:27.1-27.25 def min : (nat, nat) -> nat - ;; 0-aux.watsup:28.1-28.19 - def {j : nat} min(0, j) = 0 - ;; 0-aux.watsup:29.1-29.19 - def {i : nat} min(i, 0) = 0 ;; 0-aux.watsup:30.1-30.38 def {i : nat, j : nat} min((i + 1), (j + 1)) = $min(i, j) + ;; 0-aux.watsup:29.1-29.19 + def {i : nat} min(i, 0) = 0 + ;; 0-aux.watsup:28.1-28.19 + def {j : nat} min(0, j) = 0 } ;; 0-aux.watsup:32.1-32.21 @@ -16515,10 +16658,10 @@ rec { ;; 0-aux.watsup:32.1-32.21 def sum : nat* -> nat - ;; 0-aux.watsup:33.1-33.18 - def sum([]) = 0 ;; 0-aux.watsup:34.1-34.35 def {n : n, n'* : n*} sum([n] :: n'*{n'}) = (n + $sum(n'*{n'})) + ;; 0-aux.watsup:33.1-33.18 + def sum([]) = 0 } ;; 1-syntax.watsup:5.1-5.85 @@ -16556,17 +16699,17 @@ syntax s33 = sN ;; 1-syntax.watsup:35.1-35.21 def signif : N -> nat - ;; 1-syntax.watsup:36.1-36.21 - def signif(32) = 23 ;; 1-syntax.watsup:37.1-37.21 def signif(64) = 52 + ;; 1-syntax.watsup:36.1-36.21 + def signif(32) = 23 ;; 1-syntax.watsup:39.1-39.20 def expon : N -> nat - ;; 1-syntax.watsup:40.1-40.19 - def expon(32) = 8 ;; 1-syntax.watsup:41.1-41.20 def expon(64) = 11 + ;; 1-syntax.watsup:40.1-40.19 + def expon(32) = 8 ;; 1-syntax.watsup:43.1-43.35 def M : N -> nat @@ -17112,14 +17255,14 @@ rec { ;; 2-syntax-aux.watsup:8.1-8.33 def setminus1 : (idx, idx*) -> idx* - ;; 2-syntax-aux.watsup:13.1-13.27 - def {x : idx} setminus1(x, []) = [x] - ;; 2-syntax-aux.watsup:14.1-14.57 - def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = [] - -- if (x = y_1) ;; 2-syntax-aux.watsup:15.1-15.60 def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = $setminus1(x, y*{y}) -- otherwise + ;; 2-syntax-aux.watsup:14.1-14.57 + def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = [] + -- if (x = y_1) + ;; 2-syntax-aux.watsup:13.1-13.27 + def {x : idx} setminus1(x, []) = [x] } ;; 2-syntax-aux.watsup:7.1-7.49 @@ -17127,30 +17270,30 @@ rec { ;; 2-syntax-aux.watsup:7.1-7.49 def setminus : (idx*, idx*) -> idx* - ;; 2-syntax-aux.watsup:10.1-10.29 - def {y* : idx*} setminus([], y*{y}) = [] ;; 2-syntax-aux.watsup:11.1-11.66 def {x* : idx*, x_1 : idx, y* : idx*} setminus([x_1] :: x*{x}, y*{y}) = $setminus1(x_1, y*{y}) :: $setminus(x*{x}, y*{y}) + ;; 2-syntax-aux.watsup:10.1-10.29 + def {y* : idx*} setminus([], y*{y}) = [] } ;; 2-syntax-aux.watsup:20.1-20.68 def free_dataidx_instr : instr -> dataidx* - ;; 2-syntax-aux.watsup:21.1-21.45 - def {x : idx, y : idx} free_dataidx_instr(MEMORY.INIT_instr(x, y)) = [y] - ;; 2-syntax-aux.watsup:22.1-22.41 - def {x : idx} free_dataidx_instr(DATA.DROP_instr(x)) = [x] ;; 2-syntax-aux.watsup:23.1-23.34 def {in : instr} free_dataidx_instr(in) = [] - -;; 2-syntax-aux.watsup:25.1-25.70 + ;; 2-syntax-aux.watsup:22.1-22.41 + def {x : idx} free_dataidx_instr(DATA.DROP_instr(x)) = [x] + ;; 2-syntax-aux.watsup:21.1-21.45 + def {x : idx, y : idx} free_dataidx_instr(MEMORY.INIT_instr(x, y)) = [y] + +;; 2-syntax-aux.watsup:25.1-25.70 rec { ;; 2-syntax-aux.watsup:25.1-25.70 def free_dataidx_instrs : instr* -> dataidx* - ;; 2-syntax-aux.watsup:26.1-26.36 - def free_dataidx_instrs([]) = [] ;; 2-syntax-aux.watsup:27.1-27.99 def {instr : instr, instr'* : instr*} free_dataidx_instrs([instr] :: instr'*{instr'}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr'}) + ;; 2-syntax-aux.watsup:26.1-26.36 + def free_dataidx_instrs([]) = [] } ;; 2-syntax-aux.watsup:29.1-29.66 @@ -17168,10 +17311,10 @@ rec { ;; 2-syntax-aux.watsup:35.1-35.68 def free_dataidx_funcs : func* -> dataidx* - ;; 2-syntax-aux.watsup:36.1-36.35 - def free_dataidx_funcs([]) = [] ;; 2-syntax-aux.watsup:37.1-37.92 def {func : func, func'* : func*} free_dataidx_funcs([func] :: func'*{func'}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func'}) + ;; 2-syntax-aux.watsup:36.1-36.35 + def free_dataidx_funcs([]) = [] } ;; 2-syntax-aux.watsup:46.1-46.59 @@ -17179,67 +17322,67 @@ rec { ;; 2-syntax-aux.watsup:46.1-46.59 def concat_bytes : byte** -> byte* - ;; 2-syntax-aux.watsup:47.1-47.29 - def concat_bytes([]) = [] ;; 2-syntax-aux.watsup:48.1-48.58 def {b* : byte*, b'** : byte**} concat_bytes([b*{b}] :: b'*{b'}*{b'}) = b*{b} :: $concat_bytes(b'*{b'}*{b'}) + ;; 2-syntax-aux.watsup:47.1-47.29 + def concat_bytes([]) = [] } ;; 2-syntax-aux.watsup:59.1-59.55 def size : valtype -> nat? - ;; 2-syntax-aux.watsup:60.1-60.20 - def size(I32_valtype) = ?(32) - ;; 2-syntax-aux.watsup:61.1-61.20 - def size(I64_valtype) = ?(64) - ;; 2-syntax-aux.watsup:62.1-62.20 - def size(F32_valtype) = ?(32) - ;; 2-syntax-aux.watsup:63.1-63.20 - def size(F64_valtype) = ?(64) ;; 2-syntax-aux.watsup:64.1-64.22 def size(V128_valtype) = ?(128) + ;; 2-syntax-aux.watsup:63.1-63.20 + def size(F64_valtype) = ?(64) + ;; 2-syntax-aux.watsup:62.1-62.20 + def size(F32_valtype) = ?(32) + ;; 2-syntax-aux.watsup:61.1-61.20 + def size(I64_valtype) = ?(64) + ;; 2-syntax-aux.watsup:60.1-60.20 + def size(I32_valtype) = ?(32) def {x : valtype} size(x) = ?() ;; 2-syntax-aux.watsup:66.1-66.50 def packedsize : packedtype -> nat - ;; 2-syntax-aux.watsup:67.1-67.24 - def packedsize(I8_packedtype) = 8 ;; 2-syntax-aux.watsup:68.1-68.26 def packedsize(I16_packedtype) = 16 + ;; 2-syntax-aux.watsup:67.1-67.24 + def packedsize(I8_packedtype) = 8 ;; 2-syntax-aux.watsup:70.1-70.52 def storagesize : storagetype -> nat - ;; 2-syntax-aux.watsup:71.1-71.43 - def {valtype : valtype} storagesize($storagetype_valtype(valtype)) = !($size(valtype)) ;; 2-syntax-aux.watsup:72.1-72.55 def {packedtype : packedtype} storagesize($storagetype_packedtype(packedtype)) = $packedsize(packedtype) + ;; 2-syntax-aux.watsup:71.1-71.43 + def {valtype : valtype} storagesize($storagetype_valtype(valtype)) = !($size(valtype)) ;; 2-syntax-aux.watsup:77.1-77.62 def unpacktype : storagetype -> valtype - ;; 2-syntax-aux.watsup:78.1-78.35 - def {valtype : valtype} unpacktype($storagetype_valtype(valtype)) = valtype ;; 2-syntax-aux.watsup:79.1-79.34 def {packedtype : packedtype} unpacktype($storagetype_packedtype(packedtype)) = I32_valtype + ;; 2-syntax-aux.watsup:78.1-78.35 + def {valtype : valtype} unpacktype($storagetype_valtype(valtype)) = valtype ;; 2-syntax-aux.watsup:81.1-81.65 def unpacknumtype : storagetype -> numtype - ;; 2-syntax-aux.watsup:82.1-82.38 - def {numtype : numtype} unpacknumtype($storagetype_numtype(numtype)) = numtype ;; 2-syntax-aux.watsup:83.1-83.37 def {packedtype : packedtype} unpacknumtype($storagetype_packedtype(packedtype)) = I32_numtype + ;; 2-syntax-aux.watsup:82.1-82.38 + def {numtype : numtype} unpacknumtype($storagetype_numtype(numtype)) = numtype ;; 2-syntax-aux.watsup:85.1-85.51 def sxfield : storagetype -> sx? - ;; 2-syntax-aux.watsup:86.1-86.28 - def {valtype : valtype} sxfield($storagetype_valtype(valtype)) = ?() ;; 2-syntax-aux.watsup:87.1-87.29 def {packedtype : packedtype} sxfield($storagetype_packedtype(packedtype)) = ?(S_sx) + ;; 2-syntax-aux.watsup:86.1-86.28 + def {valtype : valtype} sxfield($storagetype_valtype(valtype)) = ?() ;; 2-syntax-aux.watsup:92.1-92.59 def diffrt : (reftype, reftype) -> reftype - ;; 2-syntax-aux.watsup:94.1-94.64 - def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) = REF_reftype(`NULL%?`(?()), ht_1) ;; 2-syntax-aux.watsup:95.1-95.65 def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?()), ht_2)) = REF_reftype(nul_1, ht_1) + ;; 2-syntax-aux.watsup:94.1-94.64 + def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) = REF_reftype(`NULL%?`(?()), ht_1) ;; 2-syntax-aux.watsup:100.1-100.42 syntax typevar = @@ -17260,14 +17403,14 @@ rec { ;; 2-syntax-aux.watsup:109.1-109.92 def subst_typevar : (typevar, typevar*, heaptype*) -> heaptype - ;; 2-syntax-aux.watsup:134.1-134.38 - def {xx : typevar} subst_typevar(xx, [], []) = $heaptype_typevar(xx) - ;; 2-syntax-aux.watsup:135.1-135.95 - def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 - -- if (xx = xx_1) ;; 2-syntax-aux.watsup:136.1-136.92 def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = $subst_typevar(xx, xx'*{xx'}, ht'*{ht'}) -- otherwise + ;; 2-syntax-aux.watsup:135.1-135.95 + def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 + -- if (xx = xx_1) + ;; 2-syntax-aux.watsup:134.1-134.38 + def {xx : typevar} subst_typevar(xx, [], []) = $heaptype_typevar(xx) } ;; 2-syntax-aux.watsup:111.1-111.92 @@ -17290,13 +17433,13 @@ rec { ;; 2-syntax-aux.watsup:113.1-113.92 def subst_heaptype : (heaptype, typevar*, heaptype*) -> heaptype - ;; 2-syntax-aux.watsup:141.1-141.67 - def {ht* : heaptype*, xx* : typevar*, xx' : typevar} subst_heaptype($heaptype_typevar(xx'), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) - ;; 2-syntax-aux.watsup:142.1-142.65 - def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_heaptype($heaptype_deftype(dt), xx*{xx}, ht*{ht}) = $heaptype_deftype($subst_deftype(dt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:143.1-143.55 def {ht* : heaptype*, ht' : heaptype, xx* : typevar*} subst_heaptype(ht', xx*{xx}, ht*{ht}) = ht' -- otherwise + ;; 2-syntax-aux.watsup:142.1-142.65 + def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_heaptype($heaptype_deftype(dt), xx*{xx}, ht*{ht}) = $heaptype_deftype($subst_deftype(dt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:141.1-141.67 + def {ht* : heaptype*, xx* : typevar*, xx' : typevar} subst_heaptype($heaptype_typevar(xx'), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) ;; 2-syntax-aux.watsup:114.1-114.92 def subst_reftype : (reftype, typevar*, heaptype*) -> reftype @@ -17305,21 +17448,21 @@ def subst_reftype : (reftype, typevar*, heaptype*) -> reftype ;; 2-syntax-aux.watsup:115.1-115.92 def subst_valtype : (valtype, typevar*, heaptype*) -> valtype - ;; 2-syntax-aux.watsup:147.1-147.64 - def {ht* : heaptype*, nt : numtype, xx* : typevar*} subst_valtype($valtype_numtype(nt), xx*{xx}, ht*{ht}) = $valtype_numtype($subst_numtype(nt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:148.1-148.64 - def {ht* : heaptype*, vt : vectype, xx* : typevar*} subst_valtype($valtype_vectype(vt), xx*{xx}, ht*{ht}) = $valtype_vectype($subst_vectype(vt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:149.1-149.64 - def {ht* : heaptype*, rt : reftype, xx* : typevar*} subst_valtype($valtype_reftype(rt), xx*{xx}, ht*{ht}) = $valtype_reftype($subst_reftype(rt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:150.1-150.40 def {ht* : heaptype*, xx* : typevar*} subst_valtype(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + ;; 2-syntax-aux.watsup:149.1-149.64 + def {ht* : heaptype*, rt : reftype, xx* : typevar*} subst_valtype($valtype_reftype(rt), xx*{xx}, ht*{ht}) = $valtype_reftype($subst_reftype(rt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:148.1-148.64 + def {ht* : heaptype*, vt : vectype, xx* : typevar*} subst_valtype($valtype_vectype(vt), xx*{xx}, ht*{ht}) = $valtype_vectype($subst_vectype(vt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:147.1-147.64 + def {ht* : heaptype*, nt : numtype, xx* : typevar*} subst_valtype($valtype_numtype(nt), xx*{xx}, ht*{ht}) = $valtype_numtype($subst_numtype(nt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:118.1-118.92 def subst_storagetype : (storagetype, typevar*, heaptype*) -> storagetype - ;; 2-syntax-aux.watsup:154.1-154.66 - def {ht* : heaptype*, t : valtype, xx* : typevar*} subst_storagetype($storagetype_valtype(t), xx*{xx}, ht*{ht}) = $storagetype_valtype($subst_valtype(t, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:155.1-155.71 def {ht* : heaptype*, pt : packedtype, xx* : typevar*} subst_storagetype($storagetype_packedtype(pt), xx*{xx}, ht*{ht}) = $storagetype_packedtype($subst_packedtype(pt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:154.1-154.66 + def {ht* : heaptype*, t : valtype, xx* : typevar*} subst_storagetype($storagetype_valtype(t), xx*{xx}, ht*{ht}) = $storagetype_valtype($subst_valtype(t, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:119.1-119.92 def subst_fieldtype : (fieldtype, typevar*, heaptype*) -> fieldtype @@ -17328,19 +17471,19 @@ def subst_fieldtype : (fieldtype, typevar*, heaptype*) -> fieldtype ;; 2-syntax-aux.watsup:121.1-121.92 def subst_comptype : (comptype, typevar*, heaptype*) -> comptype - ;; 2-syntax-aux.watsup:159.1-159.85 - def {ht* : heaptype*, xx* : typevar*, yt* : fieldtype*} subst_comptype(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) - ;; 2-syntax-aux.watsup:160.1-160.81 - def {ht* : heaptype*, xx* : typevar*, yt : fieldtype} subst_comptype(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:161.1-161.78 def {ft : functype, ht* : heaptype*, xx* : typevar*} subst_comptype(FUNC_comptype(ft), xx*{xx}, ht*{ht}) = FUNC_comptype($subst_functype(ft, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:160.1-160.81 + def {ht* : heaptype*, xx* : typevar*, yt : fieldtype} subst_comptype(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:159.1-159.85 + def {ht* : heaptype*, xx* : typevar*, yt* : fieldtype*} subst_comptype(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) ;; 2-syntax-aux.watsup:122.1-122.92 def subst_subtype : (subtype, typevar*, heaptype*) -> subtype - ;; 2-syntax-aux.watsup:163.1-164.76 - def {ct : comptype, fin : fin, ht* : heaptype*, xx* : typevar*, y* : idx*} subst_subtype(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:165.1-166.73 def {ct : comptype, fin : fin, ht* : heaptype*, ht'* : heaptype*, xx* : typevar*} subst_subtype(SUBD_subtype(fin, ht'*{ht'}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx}, ht*{ht})*{ht'}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:163.1-164.76 + def {ct : comptype, fin : fin, ht* : heaptype*, xx* : typevar*, y* : idx*} subst_subtype(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:123.1-123.92 def subst_rectype : (rectype, typevar*, heaptype*) -> rectype @@ -17375,14 +17518,14 @@ def subst_memtype : (memtype, typevar*, heaptype*) -> memtype ;; 2-syntax-aux.watsup:131.1-131.92 def subst_externtype : (externtype, typevar*, heaptype*) -> externtype - ;; 2-syntax-aux.watsup:177.1-177.79 - def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_externtype(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:178.1-178.86 - def {gt : globaltype, ht* : heaptype*, xx* : typevar*} subst_externtype(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:179.1-179.83 - def {ht* : heaptype*, tt : tabletype, xx* : typevar*} subst_externtype(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:180.1-180.77 def {ht* : heaptype*, mt : memtype, xx* : typevar*} subst_externtype(MEM_externtype(mt), xx*{xx}, ht*{ht}) = MEM_externtype($subst_memtype(mt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:179.1-179.83 + def {ht* : heaptype*, tt : tabletype, xx* : typevar*} subst_externtype(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:178.1-178.86 + def {gt : globaltype, ht* : heaptype*, xx* : typevar*} subst_externtype(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:177.1-177.79 + def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_externtype(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:183.1-183.74 def subst_all_reftype : (reftype, heaptype*) -> reftype @@ -17399,10 +17542,10 @@ rec { ;; 2-syntax-aux.watsup:189.1-189.77 def subst_all_deftypes : (deftype*, heaptype*) -> deftype* - ;; 2-syntax-aux.watsup:191.1-191.40 - def {ht* : heaptype*} subst_all_deftypes([], ht*{ht}) = [] ;; 2-syntax-aux.watsup:192.1-192.101 def {dt* : deftype*, dt_1 : deftype, ht* : heaptype*} subst_all_deftypes([dt_1] :: dt*{dt}, ht*{ht}) = [$subst_all_deftype(dt_1, ht*{ht})] :: $subst_all_deftypes(dt*{dt}, ht*{ht}) + ;; 2-syntax-aux.watsup:191.1-191.40 + def {ht* : heaptype*} subst_all_deftypes([], ht*{ht}) = [] } ;; 2-syntax-aux.watsup:197.1-197.65 @@ -17446,13 +17589,13 @@ rec { ;; 2-syntax-aux.watsup:221.1-221.64 def funcsxt : externtype* -> deftype* - ;; 2-syntax-aux.watsup:226.1-226.24 - def funcsxt([]) = [] - ;; 2-syntax-aux.watsup:227.1-227.47 - def {dt : deftype, et* : externtype*} funcsxt([FUNC_externtype(dt)] :: et*{et}) = [dt] :: $funcsxt(et*{et}) ;; 2-syntax-aux.watsup:228.1-228.59 def {et* : externtype*, externtype : externtype} funcsxt([externtype] :: et*{et}) = $funcsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:227.1-227.47 + def {dt : deftype, et* : externtype*} funcsxt([FUNC_externtype(dt)] :: et*{et}) = [dt] :: $funcsxt(et*{et}) + ;; 2-syntax-aux.watsup:226.1-226.24 + def funcsxt([]) = [] } ;; 2-syntax-aux.watsup:222.1-222.66 @@ -17460,13 +17603,13 @@ rec { ;; 2-syntax-aux.watsup:222.1-222.66 def globalsxt : externtype* -> globaltype* - ;; 2-syntax-aux.watsup:230.1-230.26 - def globalsxt([]) = [] - ;; 2-syntax-aux.watsup:231.1-231.53 - def {et* : externtype*, gt : globaltype} globalsxt([GLOBAL_externtype(gt)] :: et*{et}) = [gt] :: $globalsxt(et*{et}) ;; 2-syntax-aux.watsup:232.1-232.63 def {et* : externtype*, externtype : externtype} globalsxt([externtype] :: et*{et}) = $globalsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:231.1-231.53 + def {et* : externtype*, gt : globaltype} globalsxt([GLOBAL_externtype(gt)] :: et*{et}) = [gt] :: $globalsxt(et*{et}) + ;; 2-syntax-aux.watsup:230.1-230.26 + def globalsxt([]) = [] } ;; 2-syntax-aux.watsup:223.1-223.65 @@ -17474,13 +17617,13 @@ rec { ;; 2-syntax-aux.watsup:223.1-223.65 def tablesxt : externtype* -> tabletype* - ;; 2-syntax-aux.watsup:234.1-234.25 - def tablesxt([]) = [] - ;; 2-syntax-aux.watsup:235.1-235.50 - def {et* : externtype*, tt : tabletype} tablesxt([TABLE_externtype(tt)] :: et*{et}) = [tt] :: $tablesxt(et*{et}) ;; 2-syntax-aux.watsup:236.1-236.61 def {et* : externtype*, externtype : externtype} tablesxt([externtype] :: et*{et}) = $tablesxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:235.1-235.50 + def {et* : externtype*, tt : tabletype} tablesxt([TABLE_externtype(tt)] :: et*{et}) = [tt] :: $tablesxt(et*{et}) + ;; 2-syntax-aux.watsup:234.1-234.25 + def tablesxt([]) = [] } ;; 2-syntax-aux.watsup:224.1-224.63 @@ -17488,13 +17631,13 @@ rec { ;; 2-syntax-aux.watsup:224.1-224.63 def memsxt : externtype* -> memtype* - ;; 2-syntax-aux.watsup:238.1-238.23 - def memsxt([]) = [] - ;; 2-syntax-aux.watsup:239.1-239.44 - def {et* : externtype*, mt : memtype} memsxt([MEM_externtype(mt)] :: et*{et}) = [mt] :: $memsxt(et*{et}) ;; 2-syntax-aux.watsup:240.1-240.57 def {et* : externtype*, externtype : externtype} memsxt([externtype] :: et*{et}) = $memsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:239.1-239.44 + def {et* : externtype*, mt : memtype} memsxt([MEM_externtype(mt)] :: et*{et}) = [mt] :: $memsxt(et*{et}) + ;; 2-syntax-aux.watsup:238.1-238.23 + def memsxt([]) = [] } ;; 2-syntax-aux.watsup:249.1-249.33 @@ -17507,12 +17650,12 @@ def s33_to_u32 : s33 -> u32 ;; 3-numerics.watsup:12.1-12.57 def signed : (N, nat) -> int - ;; 3-numerics.watsup:13.1-13.54 - def {N : N, i : nat} signed(N, i) = (i <: int) - -- if (0 <= (2 ^ (N - 1))) ;; 3-numerics.watsup:14.1-14.60 def {N : N, i : nat} signed(N, i) = ((i - (2 ^ N)) <: int) -- if (((2 ^ (N - 1)) <= i) /\ (i < (2 ^ N))) + ;; 3-numerics.watsup:13.1-13.54 + def {N : N, i : nat} signed(N, i) = (i <: int) + -- if (0 <= (2 ^ (N - 1))) ;; 3-numerics.watsup:16.1-16.63 def invsigned : (N, int) -> nat @@ -17940,45 +18083,45 @@ def inst_reftype : (moduleinst, reftype) -> reftype ;; 5-runtime-aux.watsup:19.1-19.52 def default : valtype -> val? - ;; 5-runtime-aux.watsup:21.1-21.34 - def default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) - ;; 5-runtime-aux.watsup:22.1-22.34 - def default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) - ;; 5-runtime-aux.watsup:23.1-23.34 - def default(F32_valtype) = ?(CONST_val(F32_numtype, 0)) - ;; 5-runtime-aux.watsup:24.1-24.34 - def default(F64_valtype) = ?(CONST_val(F64_numtype, 0)) - ;; 5-runtime-aux.watsup:25.1-25.42 - def {ht : heaptype} default(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) ;; 5-runtime-aux.watsup:26.1-26.31 def {ht : heaptype} default(REF_valtype(`NULL%?`(?()), ht)) = ?() + ;; 5-runtime-aux.watsup:25.1-25.42 + def {ht : heaptype} default(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) + ;; 5-runtime-aux.watsup:24.1-24.34 + def default(F64_valtype) = ?(CONST_val(F64_numtype, 0)) + ;; 5-runtime-aux.watsup:23.1-23.34 + def default(F32_valtype) = ?(CONST_val(F32_numtype, 0)) + ;; 5-runtime-aux.watsup:22.1-22.34 + def default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) + ;; 5-runtime-aux.watsup:21.1-21.34 + def default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) ;; 5-runtime-aux.watsup:31.1-31.73 def packval : (storagetype, val) -> fieldval - ;; 5-runtime-aux.watsup:34.1-34.27 - def {t : valtype, val : val} packval($storagetype_valtype(t), val) = $fieldval_val(val) ;; 5-runtime-aux.watsup:35.1-35.70 def {i : nat, pt : packedtype} packval($storagetype_packedtype(pt), CONST_val(I32_numtype, i)) = PACK_fieldval(pt, $wrap(32, $packedsize(pt), i)) + ;; 5-runtime-aux.watsup:34.1-34.27 + def {t : valtype, val : val} packval($storagetype_valtype(t), val) = $fieldval_val(val) ;; 5-runtime-aux.watsup:32.1-32.83 def unpackval : (storagetype, sx?, fieldval) -> val - ;; 5-runtime-aux.watsup:37.1-37.34 - def {t : valtype, val : val} unpackval($storagetype_valtype(t), ?(), $fieldval_val(val)) = val ;; 5-runtime-aux.watsup:38.1-38.79 def {i : nat, pt : packedtype, sx : sx} unpackval($storagetype_packedtype(pt), ?(sx), PACK_fieldval(pt, i)) = CONST_val(I32_numtype, $ext($packedsize(pt), 32, sx, i)) + ;; 5-runtime-aux.watsup:37.1-37.34 + def {t : valtype, val : val} unpackval($storagetype_valtype(t), ?(), $fieldval_val(val)) = val ;; 5-runtime-aux.watsup:43.1-43.62 rec { ;; 5-runtime-aux.watsup:43.1-43.62 def funcsxv : externval* -> funcaddr* - ;; 5-runtime-aux.watsup:48.1-48.24 - def funcsxv([]) = [] - ;; 5-runtime-aux.watsup:49.1-49.47 - def {fa : funcaddr, xv* : externval*} funcsxv([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) ;; 5-runtime-aux.watsup:50.1-50.58 def {externval : externval, xv* : externval*} funcsxv([externval] :: xv*{xv}) = $funcsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:49.1-49.47 + def {fa : funcaddr, xv* : externval*} funcsxv([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:48.1-48.24 + def funcsxv([]) = [] } ;; 5-runtime-aux.watsup:44.1-44.64 @@ -17986,13 +18129,13 @@ rec { ;; 5-runtime-aux.watsup:44.1-44.64 def globalsxv : externval* -> globaladdr* - ;; 5-runtime-aux.watsup:52.1-52.26 - def globalsxv([]) = [] - ;; 5-runtime-aux.watsup:53.1-53.53 - def {ga : globaladdr, xv* : externval*} globalsxv([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) ;; 5-runtime-aux.watsup:54.1-54.62 def {externval : externval, xv* : externval*} globalsxv([externval] :: xv*{xv}) = $globalsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:53.1-53.53 + def {ga : globaladdr, xv* : externval*} globalsxv([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:52.1-52.26 + def globalsxv([]) = [] } ;; 5-runtime-aux.watsup:45.1-45.63 @@ -18000,13 +18143,13 @@ rec { ;; 5-runtime-aux.watsup:45.1-45.63 def tablesxv : externval* -> tableaddr* - ;; 5-runtime-aux.watsup:56.1-56.25 - def tablesxv([]) = [] - ;; 5-runtime-aux.watsup:57.1-57.50 - def {ta : tableaddr, xv* : externval*} tablesxv([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) ;; 5-runtime-aux.watsup:58.1-58.60 def {externval : externval, xv* : externval*} tablesxv([externval] :: xv*{xv}) = $tablesxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:57.1-57.50 + def {ta : tableaddr, xv* : externval*} tablesxv([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) + ;; 5-runtime-aux.watsup:56.1-56.25 + def tablesxv([]) = [] } ;; 5-runtime-aux.watsup:46.1-46.61 @@ -18014,13 +18157,13 @@ rec { ;; 5-runtime-aux.watsup:46.1-46.61 def memsxv : externval* -> memaddr* - ;; 5-runtime-aux.watsup:60.1-60.23 - def memsxv([]) = [] - ;; 5-runtime-aux.watsup:61.1-61.44 - def {ma : memaddr, xv* : externval*} memsxv([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) ;; 5-runtime-aux.watsup:62.1-62.56 def {externval : externval, xv* : externval*} memsxv([externval] :: xv*{xv}) = $memsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:61.1-61.44 + def {ma : memaddr, xv* : externval*} memsxv([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:60.1-60.23 + def memsxv([]) = [] } ;; 5-runtime-aux.watsup:72.1-72.57 @@ -18222,10 +18365,10 @@ rec { ;; 6-typing.watsup:26.1-26.86 def with_locals : (context, localidx*, localtype*) -> context - ;; 6-typing.watsup:28.1-28.34 - def {C : context} with_locals(C, [], []) = C ;; 6-typing.watsup:29.1-29.85 def {C : context, lt* : localtype*, lt_1 : localtype, x* : idx*, x_1 : idx} with_locals(C, [x_1] :: x*{x}, [lt_1] :: lt*{lt}) = $with_locals(C[LOCAL_context[x_1] = lt_1], x*{x}, lt*{lt}) + ;; 6-typing.watsup:28.1-28.34 + def {C : context} with_locals(C, [], []) = C } ;; 6-typing.watsup:33.1-33.65 @@ -18233,11 +18376,11 @@ rec { ;; 6-typing.watsup:33.1-33.65 def clostypes : deftype* -> deftype* - ;; 6-typing.watsup:37.1-37.26 - def clostypes([]) = [] ;; 6-typing.watsup:38.1-38.93 def {dt* : deftype*, dt'* : deftype*, dt_N : deftype} clostypes(dt*{dt} :: [dt_N]) = dt'*{dt'} :: [$subst_all_deftype(dt_N, $heaptype_deftype(dt')*{dt'})] -- if (dt'*{dt'} = $clostypes(dt*{dt})) + ;; 6-typing.watsup:37.1-37.26 + def clostypes([]) = [] } ;; 6-typing.watsup:32.1-32.65 @@ -18260,19 +18403,19 @@ relation Vectype_ok: `%|-%:OK`(context, vectype) ;; 6-typing.watsup:49.1-49.72 relation Heaptype_ok: `%|-%:OK`(context, heaptype) - ;; 6-typing.watsup:60.1-61.24 - rule abs {C : context, absheaptype : absheaptype}: - `%|-%:OK`(C, $heaptype_absheaptype(absheaptype)) + ;; 6-typing.watsup:67.1-69.22 + rule rec {C : context, i : nat, st : subtype}: + `%|-%:OK`(C, REC_heaptype(i)) + -- if (C.REC_context[i] = st) ;; 6-typing.watsup:63.1-65.23 rule typeidx {C : context, dt : deftype, x : idx}: `%|-%:OK`(C, _IDX_heaptype(x)) -- if (C.TYPE_context[x] = dt) - ;; 6-typing.watsup:67.1-69.22 - rule rec {C : context, i : nat, st : subtype}: - `%|-%:OK`(C, REC_heaptype(i)) - -- if (C.REC_context[i] = st) + ;; 6-typing.watsup:60.1-61.24 + rule abs {C : context, absheaptype : absheaptype}: + `%|-%:OK`(C, $heaptype_absheaptype(absheaptype)) ;; 6-typing.watsup:50.1-50.71 relation Reftype_ok: `%|-%:OK`(context, reftype) @@ -18283,25 +18426,25 @@ relation Reftype_ok: `%|-%:OK`(context, reftype) ;; 6-typing.watsup:51.1-51.71 relation Valtype_ok: `%|-%:OK`(context, valtype) - ;; 6-typing.watsup:75.1-77.35 - rule num {C : context, numtype : numtype}: - `%|-%:OK`(C, $valtype_numtype(numtype)) - -- Numtype_ok: `%|-%:OK`(C, numtype) - - ;; 6-typing.watsup:79.1-81.35 - rule vec {C : context, vectype : vectype}: - `%|-%:OK`(C, $valtype_vectype(vectype)) - -- Vectype_ok: `%|-%:OK`(C, vectype) + ;; 6-typing.watsup:87.1-88.16 + rule bot {C : context}: + `%|-%:OK`(C, BOT_valtype) ;; 6-typing.watsup:83.1-85.35 rule ref {C : context, reftype : reftype}: `%|-%:OK`(C, $valtype_reftype(reftype)) -- Reftype_ok: `%|-%:OK`(C, reftype) - ;; 6-typing.watsup:87.1-88.16 - rule bot {C : context}: - `%|-%:OK`(C, BOT_valtype) - + ;; 6-typing.watsup:79.1-81.35 + rule vec {C : context, vectype : vectype}: + `%|-%:OK`(C, $valtype_vectype(vectype)) + -- Vectype_ok: `%|-%:OK`(C, vectype) + + ;; 6-typing.watsup:75.1-77.35 + rule num {C : context, numtype : numtype}: + `%|-%:OK`(C, $valtype_numtype(numtype)) + -- Numtype_ok: `%|-%:OK`(C, numtype) + ;; 6-typing.watsup:93.1-93.74 relation Resulttype_ok: `%|-%:OK`(context, resulttype) ;; 6-typing.watsup:96.1-98.32 @@ -18334,16 +18477,16 @@ relation Packedtype_ok: `%|-%:OK`(context, packedtype) ;; 6-typing.watsup:114.1-114.77 relation Storagetype_ok: `%|-%:OK`(context, storagetype) - ;; 6-typing.watsup:131.1-133.35 - rule val {C : context, valtype : valtype}: - `%|-%:OK`(C, $storagetype_valtype(valtype)) - -- Valtype_ok: `%|-%:OK`(C, valtype) - ;; 6-typing.watsup:135.1-137.41 rule packed {C : context, packedtype : packedtype}: `%|-%:OK`(C, $storagetype_packedtype(packedtype)) -- Packedtype_ok: `%|-%:OK`(C, packedtype) + ;; 6-typing.watsup:131.1-133.35 + rule val {C : context, valtype : valtype}: + `%|-%:OK`(C, $storagetype_valtype(valtype)) + -- Valtype_ok: `%|-%:OK`(C, valtype) + ;; 6-typing.watsup:113.1-113.75 relation Fieldtype_ok: `%|-%:OK`(context, fieldtype) ;; 6-typing.watsup:139.1-141.34 @@ -18361,20 +18504,20 @@ relation Functype_ok: `%|-%:OK`(context, functype) ;; 6-typing.watsup:115.1-115.74 relation Comptype_ok: `%|-%:OK`(context, comptype) - ;; 6-typing.watsup:144.1-146.35 - rule struct {C : context, yt* : fieldtype*}: - `%|-%:OK`(C, STRUCT_comptype(yt*{yt})) - -- (Fieldtype_ok: `%|-%:OK`(C, yt))*{yt} + ;; 6-typing.watsup:152.1-154.31 + rule func {C : context, ft : functype}: + `%|-%:OK`(C, FUNC_comptype(ft)) + -- Functype_ok: `%|-%:OK`(C, ft) ;; 6-typing.watsup:148.1-150.32 rule array {C : context, yt : fieldtype}: `%|-%:OK`(C, ARRAY_comptype(yt)) -- Fieldtype_ok: `%|-%:OK`(C, yt) - ;; 6-typing.watsup:152.1-154.31 - rule func {C : context, ft : functype}: - `%|-%:OK`(C, FUNC_comptype(ft)) - -- Functype_ok: `%|-%:OK`(C, ft) + ;; 6-typing.watsup:144.1-146.35 + rule struct {C : context, yt* : fieldtype*}: + `%|-%:OK`(C, STRUCT_comptype(yt*{yt})) + -- (Fieldtype_ok: `%|-%:OK`(C, yt))*{yt} ;; 6-typing.watsup:391.1-391.91 relation Packedtype_sub: `%|-%<:%`(context, packedtype, packedtype) @@ -18393,113 +18536,113 @@ rec { ;; 6-typing.watsup:125.1-125.75 relation Deftype_sub: `%|-%<:%`(context, deftype, deftype) - ;; 6-typing.watsup:434.1-436.58 - rule refl {C : context, deftype_1 : deftype, deftype_2 : deftype}: - `%|-%<:%`(C, deftype_1, deftype_2) - -- if ($clostype(C, deftype_1) = $clostype(C, deftype_2)) - ;; 6-typing.watsup:438.1-441.40 rule super {C : context, ct : comptype, deftype_1 : deftype, deftype_2 : deftype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*}: `%|-%<:%`(C, deftype_1, deftype_2) -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) -- Heaptype_sub: `%|-%<:%`(C, ht, $heaptype_deftype(deftype_2)) + ;; 6-typing.watsup:434.1-436.58 + rule refl {C : context, deftype_1 : deftype, deftype_2 : deftype}: + `%|-%<:%`(C, deftype_1, deftype_2) + -- if ($clostype(C, deftype_1) = $clostype(C, deftype_2)) + ;; 6-typing.watsup:271.1-271.79 relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) - ;; 6-typing.watsup:282.1-283.28 - rule refl {C : context, heaptype : heaptype}: - `%|-%<:%`(C, heaptype, heaptype) + ;; 6-typing.watsup:343.1-344.23 + rule bot {C : context, heaptype : heaptype}: + `%|-%<:%`(C, BOT_heaptype, heaptype) - ;; 6-typing.watsup:285.1-289.48 - rule trans {C : context, heaptype' : heaptype, heaptype_1 : heaptype, heaptype_2 : heaptype}: - `%|-%<:%`(C, heaptype_1, heaptype_2) - -- Heaptype_ok: `%|-%:OK`(C, heaptype') - -- Heaptype_sub: `%|-%<:%`(C, heaptype_1, heaptype') - -- Heaptype_sub: `%|-%<:%`(C, heaptype', heaptype_2) + ;; 6-typing.watsup:339.1-341.43 + rule noextern {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NOEXTERN_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, EXTERN_heaptype) - ;; 6-typing.watsup:291.1-292.17 - rule eq-any {C : context}: - `%|-%<:%`(C, EQ_heaptype, ANY_heaptype) + ;; 6-typing.watsup:335.1-337.41 + rule nofunc {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NOFUNC_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, FUNC_heaptype) - ;; 6-typing.watsup:294.1-295.17 - rule i31-eq {C : context}: - `%|-%<:%`(C, I31_heaptype, EQ_heaptype) + ;; 6-typing.watsup:331.1-333.40 + rule none {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NONE_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, ANY_heaptype) - ;; 6-typing.watsup:297.1-298.20 - rule struct-eq {C : context}: - `%|-%<:%`(C, STRUCT_heaptype, EQ_heaptype) + ;; 6-typing.watsup:327.1-329.48 + rule rec {C : context, ct : comptype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*, i : nat}: + `%|-%<:%`(C, REC_heaptype(i), ht) + -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) - ;; 6-typing.watsup:300.1-301.19 - rule array-eq {C : context}: - `%|-%<:%`(C, ARRAY_heaptype, EQ_heaptype) + ;; 6-typing.watsup:323.1-325.52 + rule typeidx-r {C : context, heaptype : heaptype, typeidx : typeidx}: + `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, $heaptype_deftype(C.TYPE_context[typeidx])) - ;; 6-typing.watsup:303.1-305.35 - rule struct {C : context, deftype : deftype, yt* : fieldtype*}: - `%|-%<:%`(C, $heaptype_deftype(deftype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) + ;; 6-typing.watsup:319.1-321.52 + rule typeidx-l {C : context, heaptype : heaptype, typeidx : typeidx}: + `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) + -- Heaptype_sub: `%|-%<:%`(C, $heaptype_deftype(C.TYPE_context[typeidx]), heaptype) - ;; 6-typing.watsup:307.1-309.33 - rule array {C : context, deftype : deftype, yt : fieldtype}: - `%|-%<:%`(C, $heaptype_deftype(deftype), ARRAY_heaptype) - -- Expand: `%~~%`(deftype, ARRAY_comptype(yt)) + ;; 6-typing.watsup:315.1-317.46 + rule def {C : context, deftype_1 : deftype, deftype_2 : deftype}: + `%|-%<:%`(C, $heaptype_deftype(deftype_1), $heaptype_deftype(deftype_2)) + -- Deftype_sub: `%|-%<:%`(C, deftype_1, deftype_2) ;; 6-typing.watsup:311.1-313.32 rule func {C : context, deftype : deftype, ft : functype}: `%|-%<:%`(C, $heaptype_deftype(deftype), FUNC_heaptype) -- Expand: `%~~%`(deftype, FUNC_comptype(ft)) - ;; 6-typing.watsup:315.1-317.46 - rule def {C : context, deftype_1 : deftype, deftype_2 : deftype}: - `%|-%<:%`(C, $heaptype_deftype(deftype_1), $heaptype_deftype(deftype_2)) - -- Deftype_sub: `%|-%<:%`(C, deftype_1, deftype_2) + ;; 6-typing.watsup:307.1-309.33 + rule array {C : context, deftype : deftype, yt : fieldtype}: + `%|-%<:%`(C, $heaptype_deftype(deftype), ARRAY_heaptype) + -- Expand: `%~~%`(deftype, ARRAY_comptype(yt)) - ;; 6-typing.watsup:319.1-321.52 - rule typeidx-l {C : context, heaptype : heaptype, typeidx : typeidx}: - `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) - -- Heaptype_sub: `%|-%<:%`(C, $heaptype_deftype(C.TYPE_context[typeidx]), heaptype) + ;; 6-typing.watsup:303.1-305.35 + rule struct {C : context, deftype : deftype, yt* : fieldtype*}: + `%|-%<:%`(C, $heaptype_deftype(deftype), STRUCT_heaptype) + -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) - ;; 6-typing.watsup:323.1-325.52 - rule typeidx-r {C : context, heaptype : heaptype, typeidx : typeidx}: - `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, $heaptype_deftype(C.TYPE_context[typeidx])) + ;; 6-typing.watsup:300.1-301.19 + rule array-eq {C : context}: + `%|-%<:%`(C, ARRAY_heaptype, EQ_heaptype) - ;; 6-typing.watsup:327.1-329.48 - rule rec {C : context, ct : comptype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*, i : nat}: - `%|-%<:%`(C, REC_heaptype(i), ht) - -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + ;; 6-typing.watsup:297.1-298.20 + rule struct-eq {C : context}: + `%|-%<:%`(C, STRUCT_heaptype, EQ_heaptype) - ;; 6-typing.watsup:331.1-333.40 - rule none {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NONE_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, ANY_heaptype) + ;; 6-typing.watsup:294.1-295.17 + rule i31-eq {C : context}: + `%|-%<:%`(C, I31_heaptype, EQ_heaptype) - ;; 6-typing.watsup:335.1-337.41 - rule nofunc {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NOFUNC_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, FUNC_heaptype) + ;; 6-typing.watsup:291.1-292.17 + rule eq-any {C : context}: + `%|-%<:%`(C, EQ_heaptype, ANY_heaptype) - ;; 6-typing.watsup:339.1-341.43 - rule noextern {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NOEXTERN_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, EXTERN_heaptype) + ;; 6-typing.watsup:285.1-289.48 + rule trans {C : context, heaptype' : heaptype, heaptype_1 : heaptype, heaptype_2 : heaptype}: + `%|-%<:%`(C, heaptype_1, heaptype_2) + -- Heaptype_ok: `%|-%:OK`(C, heaptype') + -- Heaptype_sub: `%|-%<:%`(C, heaptype_1, heaptype') + -- Heaptype_sub: `%|-%<:%`(C, heaptype', heaptype_2) - ;; 6-typing.watsup:343.1-344.23 - rule bot {C : context, heaptype : heaptype}: - `%|-%<:%`(C, BOT_heaptype, heaptype) + ;; 6-typing.watsup:282.1-283.28 + rule refl {C : context, heaptype : heaptype}: + `%|-%<:%`(C, heaptype, heaptype) } ;; 6-typing.watsup:272.1-272.78 relation Reftype_sub: `%|-%<:%`(context, reftype, reftype) - ;; 6-typing.watsup:347.1-349.37 - rule nonnull {C : context, ht_1 : heaptype, ht_2 : heaptype}: - `%|-%<:%`(C, REF_reftype(`NULL%?`(?()), ht_1), REF_reftype(`NULL%?`(?()), ht_2)) - -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) - ;; 6-typing.watsup:351.1-353.37 rule null {C : context, ht_1 : heaptype, ht_2 : heaptype, w0 : ()?}: `%|-%<:%`(C, REF_reftype(`NULL%?`(w0), ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) + ;; 6-typing.watsup:347.1-349.37 + rule nonnull {C : context, ht_1 : heaptype, ht_2 : heaptype}: + `%|-%<:%`(C, REF_reftype(`NULL%?`(?()), ht_1), REF_reftype(`NULL%?`(?()), ht_2)) + -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) + ;; 6-typing.watsup:270.1-270.78 relation Vectype_sub: `%|-%<:%`(context, vectype, vectype) ;; 6-typing.watsup:278.1-279.26 @@ -18508,50 +18651,50 @@ relation Vectype_sub: `%|-%<:%`(context, vectype, vectype) ;; 6-typing.watsup:273.1-273.78 relation Valtype_sub: `%|-%<:%`(context, valtype, valtype) - ;; 6-typing.watsup:356.1-358.46 - rule num {C : context, numtype_1 : numtype, numtype_2 : numtype}: - `%|-%<:%`(C, $valtype_numtype(numtype_1), $valtype_numtype(numtype_2)) - -- Numtype_sub: `%|-%<:%`(C, numtype_1, numtype_2) - - ;; 6-typing.watsup:360.1-362.46 - rule vec {C : context, vectype_1 : vectype, vectype_2 : vectype}: - `%|-%<:%`(C, $valtype_vectype(vectype_1), $valtype_vectype(vectype_2)) - -- Vectype_sub: `%|-%<:%`(C, vectype_1, vectype_2) + ;; 6-typing.watsup:368.1-369.22 + rule bot {C : context, valtype : valtype}: + `%|-%<:%`(C, BOT_valtype, valtype) ;; 6-typing.watsup:364.1-366.46 rule ref {C : context, reftype_1 : reftype, reftype_2 : reftype}: `%|-%<:%`(C, $valtype_reftype(reftype_1), $valtype_reftype(reftype_2)) -- Reftype_sub: `%|-%<:%`(C, reftype_1, reftype_2) - ;; 6-typing.watsup:368.1-369.22 - rule bot {C : context, valtype : valtype}: - `%|-%<:%`(C, BOT_valtype, valtype) + ;; 6-typing.watsup:360.1-362.46 + rule vec {C : context, vectype_1 : vectype, vectype_2 : vectype}: + `%|-%<:%`(C, $valtype_vectype(vectype_1), $valtype_vectype(vectype_2)) + -- Vectype_sub: `%|-%<:%`(C, vectype_1, vectype_2) + + ;; 6-typing.watsup:356.1-358.46 + rule num {C : context, numtype_1 : numtype, numtype_2 : numtype}: + `%|-%<:%`(C, $valtype_numtype(numtype_1), $valtype_numtype(numtype_2)) + -- Numtype_sub: `%|-%<:%`(C, numtype_1, numtype_2) ;; 6-typing.watsup:392.1-392.92 relation Storagetype_sub: `%|-%<:%`(context, storagetype, storagetype) - ;; 6-typing.watsup:402.1-404.46 - rule val {C : context, valtype_1 : valtype, valtype_2 : valtype}: - `%|-%<:%`(C, $storagetype_valtype(valtype_1), $storagetype_valtype(valtype_2)) - -- Valtype_sub: `%|-%<:%`(C, valtype_1, valtype_2) - ;; 6-typing.watsup:406.1-408.55 rule packed {C : context, packedtype_1 : packedtype, packedtype_2 : packedtype}: `%|-%<:%`(C, $storagetype_packedtype(packedtype_1), $storagetype_packedtype(packedtype_2)) -- Packedtype_sub: `%|-%<:%`(C, packedtype_1, packedtype_2) + ;; 6-typing.watsup:402.1-404.46 + rule val {C : context, valtype_1 : valtype, valtype_2 : valtype}: + `%|-%<:%`(C, $storagetype_valtype(valtype_1), $storagetype_valtype(valtype_2)) + -- Valtype_sub: `%|-%<:%`(C, valtype_1, valtype_2) + ;; 6-typing.watsup:393.1-393.90 relation Fieldtype_sub: `%|-%<:%`(context, fieldtype, fieldtype) - ;; 6-typing.watsup:411.1-413.40 - rule const {C : context, zt_1 : storagetype, zt_2 : storagetype}: - `%|-%<:%`(C, `%%`(`MUT%?`(?()), zt_1), `%%`(`MUT%?`(?()), zt_2)) - -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) - ;; 6-typing.watsup:415.1-418.40 rule var {C : context, zt_1 : storagetype, zt_2 : storagetype}: `%|-%<:%`(C, `%%`(`MUT%?`(?(())), zt_1), `%%`(`MUT%?`(?(())), zt_2)) -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) + ;; 6-typing.watsup:411.1-413.40 + rule const {C : context, zt_1 : storagetype, zt_2 : storagetype}: + `%|-%<:%`(C, `%%`(`MUT%?`(?()), zt_1), `%%`(`MUT%?`(?()), zt_2)) + -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) + ;; 6-typing.watsup:395.1-395.89 relation Functype_sub: `%|-%<:%`(context, functype, functype) ;; 6-typing.watsup:458.1-459.16 @@ -18560,20 +18703,20 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) ;; 6-typing.watsup:124.1-124.76 relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) - ;; 6-typing.watsup:421.1-423.41 - rule struct {C : context, yt'_1 : fieldtype, yt_1* : fieldtype*, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) - -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} + ;; 6-typing.watsup:429.1-431.37 + rule func {C : context, ft_1 : functype, ft_2 : functype}: + `%|-%<:%`(C, FUNC_comptype(ft_1), FUNC_comptype(ft_2)) + -- Functype_sub: `%|-%<:%`(C, ft_1, ft_2) ;; 6-typing.watsup:425.1-427.38 rule array {C : context, yt_1 : fieldtype, yt_2 : fieldtype}: `%|-%<:%`(C, ARRAY_comptype(yt_1), ARRAY_comptype(yt_2)) -- Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2) - ;; 6-typing.watsup:429.1-431.37 - rule func {C : context, ft_1 : functype, ft_2 : functype}: - `%|-%<:%`(C, FUNC_comptype(ft_1), FUNC_comptype(ft_2)) - -- Functype_sub: `%|-%<:%`(C, ft_1, ft_2) + ;; 6-typing.watsup:421.1-423.41 + rule struct {C : context, yt'_1 : fieldtype, yt_1* : fieldtype*, yt_2* : fieldtype*}: + `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) + -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} ;; 6-typing.watsup:117.1-117.73 relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) @@ -18588,21 +18731,21 @@ relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) ;; 6-typing.watsup:165.1-165.65 def before : (heaptype, typeidx, nat) -> bool - ;; 6-typing.watsup:166.1-166.34 - def {deftype : deftype, i : nat, x : idx} before($heaptype_deftype(deftype), x, i) = true - ;; 6-typing.watsup:167.1-167.46 - def {i : nat, typeidx : typeidx, x : idx} before(_IDX_heaptype(typeidx), x, i) = (typeidx < x) ;; 6-typing.watsup:168.1-168.33 def {i : nat, j : nat, x : idx} before(REC_heaptype(j), x, i) = (j < i) + ;; 6-typing.watsup:167.1-167.46 + def {i : nat, typeidx : typeidx, x : idx} before(_IDX_heaptype(typeidx), x, i) = (typeidx < x) + ;; 6-typing.watsup:166.1-166.34 + def {deftype : deftype, i : nat, x : idx} before($heaptype_deftype(deftype), x, i) = true ;; 6-typing.watsup:170.1-170.69 def unrollht : (context, heaptype) -> subtype - ;; 6-typing.watsup:171.1-171.47 - def {C : context, deftype : deftype} unrollht(C, $heaptype_deftype(deftype)) = $unrolldt(deftype) - ;; 6-typing.watsup:172.1-172.60 - def {C : context, typeidx : typeidx} unrollht(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx]) ;; 6-typing.watsup:173.1-173.35 def {C : context, i : nat} unrollht(C, REC_heaptype(i)) = C.REC_context[i] + ;; 6-typing.watsup:172.1-172.60 + def {C : context, typeidx : typeidx} unrollht(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx]) + ;; 6-typing.watsup:171.1-171.47 + def {C : context, deftype : deftype} unrollht(C, $heaptype_deftype(deftype)) = $unrolldt(deftype) ;; 6-typing.watsup:119.1-119.76 relation Subtype_ok2: `%|-%:%`(context, subtype, oktypeidxnat) @@ -18620,15 +18763,15 @@ rec { ;; 6-typing.watsup:120.1-120.76 relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) - ;; 6-typing.watsup:196.1-197.24 - rule empty {C : context, i : nat, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) - ;; 6-typing.watsup:199.1-202.50 rule cons {C : context, i : nat, st* : subtype*, st_1 : subtype, x : idx}: `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidxnat((x + 1), (i + 1))) + + ;; 6-typing.watsup:196.1-197.24 + rule empty {C : context, i : nat, x : idx}: + `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) } ;; 6-typing.watsup:118.1-118.74 @@ -18636,9 +18779,10 @@ rec { ;; 6-typing.watsup:118.1-118.74 relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) - ;; 6-typing.watsup:184.1-185.23 - rule empty {C : context, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) + ;; 6-typing.watsup:192.1-194.49 + rule rec2 {C : context, st* : subtype*, x : idx}: + `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) ;; 6-typing.watsup:187.1-190.43 rule cons {C : context, st* : subtype*, st_1 : subtype, x : idx}: @@ -18646,10 +18790,9 @@ relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x + 1)) - ;; 6-typing.watsup:192.1-194.49 - rule rec2 {C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) + ;; 6-typing.watsup:184.1-185.23 + rule empty {C : context, x : idx}: + `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) } ;; 6-typing.watsup:121.1-121.73 @@ -18692,26 +18835,26 @@ relation Memtype_ok: `%|-%:OK`(context, memtype) ;; 6-typing.watsup:218.1-218.74 relation Externtype_ok: `%|-%:OK`(context, externtype) - ;; 6-typing.watsup:244.1-247.27 - rule func {C : context, dt : deftype, ft : functype}: - `%|-%:OK`(C, FUNC_externtype(dt)) - -- Deftype_ok: `%|-%:OK`(C, dt) - -- Expand: `%~~%`(dt, FUNC_comptype(ft)) - - ;; 6-typing.watsup:249.1-251.33 - rule global {C : context, gt : globaltype}: - `%|-%:OK`(C, GLOBAL_externtype(gt)) - -- Globaltype_ok: `%|-%:OK`(C, gt) + ;; 6-typing.watsup:257.1-259.30 + rule mem {C : context, mt : memtype}: + `%|-%:OK`(C, MEM_externtype(mt)) + -- Memtype_ok: `%|-%:OK`(C, mt) ;; 6-typing.watsup:253.1-255.32 rule table {C : context, tt : tabletype}: `%|-%:OK`(C, TABLE_externtype(tt)) -- Tabletype_ok: `%|-%:OK`(C, tt) - ;; 6-typing.watsup:257.1-259.30 - rule mem {C : context, mt : memtype}: - `%|-%:OK`(C, MEM_externtype(mt)) - -- Memtype_ok: `%|-%:OK`(C, mt) + ;; 6-typing.watsup:249.1-251.33 + rule global {C : context, gt : globaltype}: + `%|-%:OK`(C, GLOBAL_externtype(gt)) + -- Globaltype_ok: `%|-%:OK`(C, gt) + + ;; 6-typing.watsup:244.1-247.27 + rule func {C : context, dt : deftype, ft : functype}: + `%|-%:OK`(C, FUNC_externtype(dt)) + -- Deftype_ok: `%|-%:OK`(C, dt) + -- Expand: `%~~%`(dt, FUNC_comptype(ft)) ;; 6-typing.watsup:374.1-374.81 relation Resulttype_sub: `%|-%*<:%*`(context, valtype*, valtype*) @@ -18740,17 +18883,17 @@ relation Limits_sub: `%|-%<:%`(context, limits, limits) ;; 6-typing.watsup:447.1-447.83 relation Globaltype_sub: `%|-%<:%`(context, globaltype, globaltype) - ;; 6-typing.watsup:461.1-463.34 - rule const {C : context, t_1 : valtype, t_2 : valtype}: - `%|-%<:%`(C, `%%`(`MUT%?`(?()), t_1), `%%`(`MUT%?`(?()), t_2)) - -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) - ;; 6-typing.watsup:465.1-468.34 rule var {C : context, t_1 : valtype, t_2 : valtype}: `%|-%<:%`(C, `%%`(`MUT%?`(?(())), t_1), `%%`(`MUT%?`(?(())), t_2)) -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) -- Valtype_sub: `%|-%<:%`(C, t_2, t_1) + ;; 6-typing.watsup:461.1-463.34 + rule const {C : context, t_1 : valtype, t_2 : valtype}: + `%|-%<:%`(C, `%%`(`MUT%?`(?()), t_1), `%%`(`MUT%?`(?()), t_2)) + -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) + ;; 6-typing.watsup:448.1-448.82 relation Tabletype_sub: `%|-%<:%`(context, tabletype, tabletype) ;; 6-typing.watsup:470.1-474.36 @@ -18769,280 +18912,240 @@ relation Memtype_sub: `%|-%<:%`(context, memtype, memtype) ;; 6-typing.watsup:450.1-450.83 relation Externtype_sub: `%|-%<:%`(context, externtype, externtype) - ;; 6-typing.watsup:481.1-483.36 - rule func {C : context, dt_1 : deftype, dt_2 : deftype}: - `%|-%<:%`(C, FUNC_externtype(dt_1), FUNC_externtype(dt_2)) - -- Deftype_sub: `%|-%<:%`(C, dt_1, dt_2) - - ;; 6-typing.watsup:485.1-487.39 - rule global {C : context, gt_1 : globaltype, gt_2 : globaltype}: - `%|-%<:%`(C, GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) - -- Globaltype_sub: `%|-%<:%`(C, gt_1, gt_2) + ;; 6-typing.watsup:493.1-495.36 + rule mem {C : context, mt_1 : memtype, mt_2 : memtype}: + `%|-%<:%`(C, MEM_externtype(mt_1), MEM_externtype(mt_2)) + -- Memtype_sub: `%|-%<:%`(C, mt_1, mt_2) ;; 6-typing.watsup:489.1-491.38 rule table {C : context, tt_1 : tabletype, tt_2 : tabletype}: `%|-%<:%`(C, TABLE_externtype(tt_1), TABLE_externtype(tt_2)) -- Tabletype_sub: `%|-%<:%`(C, tt_1, tt_2) - ;; 6-typing.watsup:493.1-495.36 - rule mem {C : context, mt_1 : memtype, mt_2 : memtype}: - `%|-%<:%`(C, MEM_externtype(mt_1), MEM_externtype(mt_2)) - -- Memtype_sub: `%|-%<:%`(C, mt_1, mt_2) + ;; 6-typing.watsup:485.1-487.39 + rule global {C : context, gt_1 : globaltype, gt_2 : globaltype}: + `%|-%<:%`(C, GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) + -- Globaltype_sub: `%|-%<:%`(C, gt_1, gt_2) + + ;; 6-typing.watsup:481.1-483.36 + rule func {C : context, dt_1 : deftype, dt_2 : deftype}: + `%|-%<:%`(C, FUNC_externtype(dt_1), FUNC_externtype(dt_2)) + -- Deftype_sub: `%|-%<:%`(C, dt_1, dt_2) ;; 6-typing.watsup:565.1-565.76 relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) - ;; 6-typing.watsup:567.1-568.32 - rule void {C : context}: - `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) + ;; 6-typing.watsup:573.1-575.34 + rule typeidx {C : context, ft : functype, x : idx}: + `%|-%:%`(C, _IDX_blocktype(x), ft) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(ft)) ;; 6-typing.watsup:570.1-571.28 rule result {C : context, t : valtype}: `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`([], [t])) - ;; 6-typing.watsup:573.1-575.34 - rule typeidx {C : context, ft : functype, x : idx}: - `%|-%:%`(C, _IDX_blocktype(x), ft) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(ft)) + ;; 6-typing.watsup:567.1-568.32 + rule void {C : context}: + `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) ;; 6-typing.watsup:503.1-505.74 rec { ;; 6-typing.watsup:503.1-503.67 relation Instr_ok: `%|-%:%`(context, instr, functype) - ;; 6-typing.watsup:544.1-545.34 - rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) - - ;; 6-typing.watsup:547.1-548.24 - rule nop {C : context}: - `%|-%:%`(C, NOP_instr, `%->%`([], [])) - - ;; 6-typing.watsup:550.1-551.23 - rule drop {C : context, t : valtype}: - `%|-%:%`(C, DROP_instr, `%->%`([t], [])) - - ;; 6-typing.watsup:554.1-555.31 - rule select-expl {C : context, t : valtype}: - `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) - - ;; 6-typing.watsup:557.1-560.37 - rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: - `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) - -- Valtype_sub: `%|-%<:%`(C, t, t') - -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) + ;; 6-typing.watsup:951.1-956.29 + rule store {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, x : idx, o0 : nat, o1? : nat?}: + `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype $valtype_numtype(nt)], [])) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- (if ($size($valtype_numtype(nt)) = ?(o1)))?{o1} + -- if (C.MEM_context[x] = mt) + -- if ((2 ^ n_A) <= (o0 / 8)) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} + -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) - ;; 6-typing.watsup:578.1-581.61 - rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:944.1-949.29 + rule load {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, x : idx, o0 : nat, o1? : nat?}: + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [$valtype_numtype(nt)])) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- (if ($size($valtype_numtype(nt)) = ?(o1)))?{o1} + -- if (C.MEM_context[x] = mt) + -- if ((2 ^ n_A) <= (o0 / 8)) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} + -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) - ;; 6-typing.watsup:583.1-586.61 - rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:940.1-942.23 + rule data.drop {C : context, x : idx}: + `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) + -- if (C.DATA_context[x] = OK) - ;; 6-typing.watsup:588.1-592.65 - rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: - `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) + ;; 6-typing.watsup:935.1-938.23 + rule memory.init {C : context, mt : memtype, x : idx, y : idx}: + `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x] = mt) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:597.1-599.24 - rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.LABEL_context[l] = t*{t}) + ;; 6-typing.watsup:930.1-933.26 + rule memory.copy {C : context, mt_1 : memtype, mt_2 : memtype, x_1 : idx, x_2 : idx}: + `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x_1] = mt_1) + -- if (C.MEM_context[x_2] = mt_2) - ;; 6-typing.watsup:601.1-603.24 - rule br_if {C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) - -- if (C.LABEL_context[l] = t*{t}) + ;; 6-typing.watsup:926.1-928.22 + rule memory.fill {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:605.1-608.44 - rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- (Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l]))*{l} - -- Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l']) + ;; 6-typing.watsup:922.1-924.22 + rule memory.grow {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:610.1-613.31 - rule br_on_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (C.LABEL_context[l] = t*{t}) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:918.1-920.22 + rule memory.size {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:615.1-618.31 - rule br_on_non_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) - -- if (C.LABEL_context[l] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:911.1-913.23 + rule elem.drop {C : context, rt : reftype, x : idx}: + `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) + -- if (C.ELEM_context[x] = rt) - ;; 6-typing.watsup:620.1-626.34 - rule br_on_cast {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype($diffrt(rt_1, rt_2))])) - -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) - -- Reftype_ok: `%|-%:OK`(C, rt_1) - -- Reftype_ok: `%|-%:OK`(C, rt_2) + ;; 6-typing.watsup:905.1-909.36 + rule table.init {C : context, lim : limits, rt_1 : reftype, rt_2 : reftype, x : idx, y : idx}: + `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.TABLE_context[x] = `%%`(lim, rt_1)) + -- if (C.ELEM_context[y] = rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) - ;; 6-typing.watsup:628.1-634.49 - rule br_on_cast_fail {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype(rt_2)])) - -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) - -- Reftype_ok: `%|-%:OK`(C, rt_1) - -- Reftype_ok: `%|-%:OK`(C, rt_2) + ;; 6-typing.watsup:899.1-903.36 + rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt_1 : reftype, rt_2 : reftype, x_1 : idx, x_2 : idx}: + `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt_1)) + -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt_2)) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) - - ;; 6-typing.watsup:639.1-641.24 - rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.RETURN_context = ?(t*{t})) - - ;; 6-typing.watsup:643.1-645.46 - rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:647.1-649.46 - rule call_ref {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_2*{t_2})) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + ;; 6-typing.watsup:895.1-897.28 + rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:651.1-655.46 - rule call_indirect {C : context, lim : limits, rt : reftype, t_1* : valtype*, t_2* : valtype*, x : idx, y : idx}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + ;; 6-typing.watsup:891.1-893.28 + rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:657.1-661.40 - rule return_call {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) - -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - - ;; 6-typing.watsup:663.1-667.40 - rule return_call_ref {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_4*{t_4})) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + ;; 6-typing.watsup:887.1-889.24 + rule table.size {C : context, tt : tabletype, x : idx}: + `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) + -- if (C.TABLE_context[x] = tt) - ;; 6-typing.watsup:669.1-675.40 - rule return_call_indirect {C : context, lim : limits, rt : reftype, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx, y : idx}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) + ;; 6-typing.watsup:883.1-885.28 + rule table.set {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - - ;; 6-typing.watsup:680.1-681.33 - rule const {C : context, c_nt : c, nt : numtype}: - `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:683.1-684.31 - rule unop {C : context, nt : numtype, unop : unop_numtype}: - `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) + ;; 6-typing.watsup:879.1-881.28 + rule table.get {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:686.1-687.36 - rule binop {C : context, binop : binop_numtype, nt : numtype}: - `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) + ;; 6-typing.watsup:872.1-874.28 + rule global.set {C : context, t : valtype, x : idx}: + `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) + -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?(())), t)) - ;; 6-typing.watsup:689.1-690.36 - rule testop {C : context, nt : numtype, testop : testop_numtype}: - `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) + ;; 6-typing.watsup:868.1-870.28 + rule global.get {C : context, mut : mut, t : valtype, x : idx}: + `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) + -- if (C.GLOBAL_context[x] = `%%`(mut, t)) - ;; 6-typing.watsup:692.1-693.37 - rule relop {C : context, nt : numtype, relop : relop_numtype}: - `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) + ;; 6-typing.watsup:853.1-855.28 + rule local.get {C : context, init : init, t : valtype, x : idx}: + `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) + -- if (C.LOCAL_context[x] = `%%`(init, t)) - ;; 6-typing.watsup:696.1-698.23 - rule extend {C : context, n : n, nt : numtype, o0 : nat}: - `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if (n <= o0) + ;; 6-typing.watsup:847.1-848.62 + rule any.convert_extern {C : context, nul : nul}: + `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) - ;; 6-typing.watsup:700.1-703.34 - rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype, o0 : nat, o1 : nat}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) - -- if ($size($valtype_numtype(nt_1)) = ?(o0)) - -- if ($size($valtype_numtype(nt_2)) = ?(o1)) - -- if (nt_1 =/= nt_2) - -- if (o0 = o1) + ;; 6-typing.watsup:844.1-845.62 + rule extern.convert_any {C : context, nul : nul}: + `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) - ;; 6-typing.watsup:705.1-708.50 - rule convert-i {C : context, inn_1 : inn, inn_2 : inn, sx? : sx?, o0 : nat, o1 : nat}: - `%|-%:%`(C, CVTOP_instr($numtype_inn(inn_1), CONVERT_cvtop, $numtype_inn(inn_2), sx?{sx}), `%->%`([$valtype_inn(inn_2)], [$valtype_inn(inn_1)])) - -- if ($size($valtype_inn(inn_1)) = ?(o0)) - -- if ($size($valtype_inn(inn_2)) = ?(o1)) - -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> (o0 > o1)) + ;; 6-typing.watsup:835.1-839.23 + rule array.init_data {C : context, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:710.1-712.24 - rule convert-f {C : context, fnn_1 : fnn, fnn_2 : fnn}: - `%|-%:%`(C, CVTOP_instr($numtype_fnn(fnn_1), CONVERT_cvtop, $numtype_fnn(fnn_2), ?()), `%->%`([$valtype_fnn(fnn_2)], [$valtype_fnn(fnn_1)])) - -- if (fnn_1 =/= fnn_2) + ;; 6-typing.watsup:830.1-833.43 + rule array.init_elem {C : context, x : idx, y : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- Storagetype_sub: `%|-%<:%`(C, $storagetype_elemtype(C.ELEM_context[y]), zt) - ;; 6-typing.watsup:717.1-719.31 - rule ref.null {C : context, ht : heaptype}: - `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:824.1-828.40 + rule array.copy {C : context, mut : mut, x_1 : idx, x_2 : idx, zt_1 : storagetype, zt_2 : storagetype}: + `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_1))) I32_valtype REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_2))) I32_valtype I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x_1], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) + -- Expand: `%~~%`(C.TYPE_context[x_2], ARRAY_comptype(`%%`(mut, zt_2))) + -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) - ;; 6-typing.watsup:722.1-724.23 - rule ref.func {C : context, dt : deftype, epsilon : resulttype, x : idx}: - `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), $heaptype_deftype(dt))])) - -- if (C.FUNC_context[x] = dt) + ;; 6-typing.watsup:820.1-822.41 + rule array.fill {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt) I32_valtype], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:726.1-727.34 - rule ref.i31 {C : context}: - `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) + ;; 6-typing.watsup:816.1-818.41 + rule array.len {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:729.1-730.31 - rule ref.is_null {C : context, rt : reftype}: - `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) + ;; 6-typing.watsup:812.1-814.41 + rule array.set {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt)], [])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:732.1-734.31 - rule ref.as_non_null {C : context, ht : heaptype}: - `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:807.1-810.43 + rule array.get {C : context, mut : mut, sx? : sx?, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype], [$unpacktype(zt)])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) - ;; 6-typing.watsup:736.1-737.51 - rule ref.eq {C : context}: - `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) + ;; 6-typing.watsup:801.1-805.23 + rule array.new_data {C : context, mut : mut, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx}: + `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_valtype(t)))) + -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:739.1-743.33 - rule ref.test {C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([$valtype_reftype(rt')], [I32_valtype])) - -- Reftype_ok: `%|-%:OK`(C, rt) - -- Reftype_ok: `%|-%:OK`(C, rt') - -- Reftype_sub: `%|-%<:%`(C, rt, rt') + ;; 6-typing.watsup:796.1-799.39 + rule array.new_elem {C : context, mut : mut, rt : reftype, x : idx, y : idx}: + `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_reftype(rt)))) + -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y], rt) - ;; 6-typing.watsup:745.1-749.33 - rule ref.cast {C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([$valtype_reftype(rt')], [$valtype_reftype(rt)])) - -- Reftype_ok: `%|-%:OK`(C, rt) - -- Reftype_ok: `%|-%:OK`(C, rt') - -- Reftype_sub: `%|-%<:%`(C, rt, rt') + ;; 6-typing.watsup:792.1-794.41 + rule array.new_fixed {C : context, mut : mut, n : n, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpacktype(zt)], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - ;; 6-typing.watsup:754.1-755.42 - rule i31.get {C : context, sx : sx}: - `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) + ;; 6-typing.watsup:787.1-790.40 + rule array.new_default {C : context, mut : mut, val : val, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- if ($default($unpacktype(zt)) = ?(val)) - ;; 6-typing.watsup:760.1-762.43 - rule struct.new {C : context, mut* : mut*, x : idx, zt* : storagetype*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + ;; 6-typing.watsup:783.1-785.41 + rule array.new {C : context, mut : mut, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpacktype(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - ;; 6-typing.watsup:764.1-767.43 - rule struct.new_default {C : context, mut* : mut*, val* : val*, x : idx, zt* : storagetype*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} + ;; 6-typing.watsup:775.1-778.24 + rule struct.set {C : context, i : nat, x : idx, yt* : fieldtype*, zt : storagetype}: + `%|-%:%`(C, STRUCT.SET_instr(x, i), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) $unpacktype(zt)], [])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) + -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) ;; 6-typing.watsup:769.1-773.43 rule struct.get {C : context, i : nat, mut : mut, sx? : sx?, x : idx, yt* : fieldtype*, zt : storagetype}: @@ -19051,223 +19154,270 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- if (yt*{yt}[i] = `%%`(mut, zt)) -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) - ;; 6-typing.watsup:775.1-778.24 - rule struct.set {C : context, i : nat, x : idx, yt* : fieldtype*, zt : storagetype}: - `%|-%:%`(C, STRUCT.SET_instr(x, i), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) $unpacktype(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) - - ;; 6-typing.watsup:783.1-785.41 - rule array.new {C : context, mut : mut, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpacktype(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + ;; 6-typing.watsup:764.1-767.43 + rule struct.new_default {C : context, mut* : mut*, val* : val*, x : idx, zt* : storagetype*}: + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} - ;; 6-typing.watsup:787.1-790.40 - rule array.new_default {C : context, mut : mut, val : val, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - -- if ($default($unpacktype(zt)) = ?(val)) + ;; 6-typing.watsup:760.1-762.43 + rule struct.new {C : context, mut* : mut*, x : idx, zt* : storagetype*}: + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - ;; 6-typing.watsup:792.1-794.41 - rule array.new_fixed {C : context, mut : mut, n : n, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpacktype(zt)], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + ;; 6-typing.watsup:754.1-755.42 + rule i31.get {C : context, sx : sx}: + `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) - ;; 6-typing.watsup:796.1-799.39 - rule array.new_elem {C : context, mut : mut, rt : reftype, x : idx, y : idx}: - `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_reftype(rt)))) - -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y], rt) + ;; 6-typing.watsup:745.1-749.33 + rule ref.cast {C : context, rt : reftype, rt' : reftype}: + `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([$valtype_reftype(rt')], [$valtype_reftype(rt)])) + -- Reftype_ok: `%|-%:OK`(C, rt) + -- Reftype_ok: `%|-%:OK`(C, rt') + -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:801.1-805.23 - rule array.new_data {C : context, mut : mut, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx}: - `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_valtype(t)))) - -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:739.1-743.33 + rule ref.test {C : context, rt : reftype, rt' : reftype}: + `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([$valtype_reftype(rt')], [I32_valtype])) + -- Reftype_ok: `%|-%:OK`(C, rt) + -- Reftype_ok: `%|-%:OK`(C, rt') + -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:807.1-810.43 - rule array.get {C : context, mut : mut, sx? : sx?, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype], [$unpacktype(zt)])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) + ;; 6-typing.watsup:736.1-737.51 + rule ref.eq {C : context}: + `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) - ;; 6-typing.watsup:812.1-814.41 - rule array.set {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt)], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:732.1-734.31 + rule ref.as_non_null {C : context, ht : heaptype}: + `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:816.1-818.41 - rule array.len {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:729.1-730.31 + rule ref.is_null {C : context, rt : reftype}: + `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) - ;; 6-typing.watsup:820.1-822.41 - rule array.fill {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt) I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:726.1-727.34 + rule ref.i31 {C : context}: + `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) - ;; 6-typing.watsup:824.1-828.40 - rule array.copy {C : context, mut : mut, x_1 : idx, x_2 : idx, zt_1 : storagetype, zt_2 : storagetype}: - `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_1))) I32_valtype REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_2))) I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x_1], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) - -- Expand: `%~~%`(C.TYPE_context[x_2], ARRAY_comptype(`%%`(mut, zt_2))) - -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) + ;; 6-typing.watsup:722.1-724.23 + rule ref.func {C : context, dt : deftype, epsilon : resulttype, x : idx}: + `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), $heaptype_deftype(dt))])) + -- if (C.FUNC_context[x] = dt) - ;; 6-typing.watsup:830.1-833.43 - rule array.init_elem {C : context, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- Storagetype_sub: `%|-%<:%`(C, $storagetype_elemtype(C.ELEM_context[y]), zt) + ;; 6-typing.watsup:717.1-719.31 + rule ref.null {C : context, ht : heaptype}: + `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:835.1-839.23 - rule array.init_data {C : context, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:710.1-712.24 + rule convert-f {C : context, fnn_1 : fnn, fnn_2 : fnn}: + `%|-%:%`(C, CVTOP_instr($numtype_fnn(fnn_1), CONVERT_cvtop, $numtype_fnn(fnn_2), ?()), `%->%`([$valtype_fnn(fnn_2)], [$valtype_fnn(fnn_1)])) + -- if (fnn_1 =/= fnn_2) - ;; 6-typing.watsup:844.1-845.62 - rule extern.convert_any {C : context, nul : nul}: - `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) + ;; 6-typing.watsup:705.1-708.50 + rule convert-i {C : context, inn_1 : inn, inn_2 : inn, sx? : sx?, o0 : nat, o1 : nat}: + `%|-%:%`(C, CVTOP_instr($numtype_inn(inn_1), CONVERT_cvtop, $numtype_inn(inn_2), sx?{sx}), `%->%`([$valtype_inn(inn_2)], [$valtype_inn(inn_1)])) + -- if ($size($valtype_inn(inn_1)) = ?(o0)) + -- if ($size($valtype_inn(inn_2)) = ?(o1)) + -- if (inn_1 =/= inn_2) + -- if ((sx?{sx} = ?()) <=> (o0 > o1)) - ;; 6-typing.watsup:847.1-848.62 - rule any.convert_extern {C : context, nul : nul}: - `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) + ;; 6-typing.watsup:700.1-703.34 + rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype, o0 : nat, o1 : nat}: + `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) + -- if ($size($valtype_numtype(nt_1)) = ?(o0)) + -- if ($size($valtype_numtype(nt_2)) = ?(o1)) + -- if (nt_1 =/= nt_2) + -- if (o0 = o1) - ;; 6-typing.watsup:853.1-855.28 - rule local.get {C : context, init : init, t : valtype, x : idx}: - `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) - -- if (C.LOCAL_context[x] = `%%`(init, t)) + ;; 6-typing.watsup:696.1-698.23 + rule extend {C : context, n : n, nt : numtype, o0 : nat}: + `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if (n <= o0) - ;; 6-typing.watsup:868.1-870.28 - rule global.get {C : context, mut : mut, t : valtype, x : idx}: - `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) - -- if (C.GLOBAL_context[x] = `%%`(mut, t)) + ;; 6-typing.watsup:692.1-693.37 + rule relop {C : context, nt : numtype, relop : relop_numtype}: + `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) - ;; 6-typing.watsup:872.1-874.28 - rule global.set {C : context, t : valtype, x : idx}: - `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) - -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?(())), t)) + ;; 6-typing.watsup:689.1-690.36 + rule testop {C : context, nt : numtype, testop : testop_numtype}: + `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) - ;; 6-typing.watsup:879.1-881.28 - rule table.get {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:686.1-687.36 + rule binop {C : context, binop : binop_numtype, nt : numtype}: + `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:883.1-885.28 - rule table.set {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:683.1-684.31 + rule unop {C : context, nt : numtype, unop : unop_numtype}: + `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:887.1-889.24 - rule table.size {C : context, tt : tabletype, x : idx}: - `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) - -- if (C.TABLE_context[x] = tt) + ;; 6-typing.watsup:680.1-681.33 + rule const {C : context, c_nt : c, nt : numtype}: + `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:891.1-893.28 - rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) + ;; 6-typing.watsup:669.1-675.40 + rule return_call_indirect {C : context, lim : limits, rt : reftype, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx, y : idx}: + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) + -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:895.1-897.28 - rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) + ;; 6-typing.watsup:663.1-667.40 + rule return_call_ref {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_4*{t_4})) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + + ;; 6-typing.watsup:657.1-661.40 + rule return_call {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) + -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + + ;; 6-typing.watsup:651.1-655.46 + rule call_indirect {C : context, lim : limits, rt : reftype, t_1* : valtype*, t_2* : valtype*, x : idx, y : idx}: + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) + -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:899.1-903.36 - rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt_1 : reftype, rt_2 : reftype, x_1 : idx, x_2 : idx}: - `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt_1)) - -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt_2)) + ;; 6-typing.watsup:647.1-649.46 + rule call_ref {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_2*{t_2})) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + + ;; 6-typing.watsup:643.1-645.46 + rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: + `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + + ;; 6-typing.watsup:639.1-641.24 + rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- if (C.RETURN_context = ?(t*{t})) + + ;; 6-typing.watsup:628.1-634.49 + rule br_on_cast_fail {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype(rt_2)])) + -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) + -- Reftype_ok: `%|-%:OK`(C, rt_1) + -- Reftype_ok: `%|-%:OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) - ;; 6-typing.watsup:905.1-909.36 - rule table.init {C : context, lim : limits, rt_1 : reftype, rt_2 : reftype, x : idx, y : idx}: - `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.TABLE_context[x] = `%%`(lim, rt_1)) - -- if (C.ELEM_context[y] = rt_2) + ;; 6-typing.watsup:620.1-626.34 + rule br_on_cast {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype($diffrt(rt_1, rt_2))])) + -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) + -- Reftype_ok: `%|-%:OK`(C, rt_1) + -- Reftype_ok: `%|-%:OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) - ;; 6-typing.watsup:911.1-913.23 - rule elem.drop {C : context, rt : reftype, x : idx}: - `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) - -- if (C.ELEM_context[x] = rt) + ;; 6-typing.watsup:615.1-618.31 + rule br_on_non_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) + -- if (C.LABEL_context[l] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:918.1-920.22 - rule memory.size {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:610.1-613.31 + rule br_on_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) + -- if (C.LABEL_context[l] = t*{t}) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:922.1-924.22 - rule memory.grow {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:605.1-608.44 + rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- (Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l]))*{l} + -- Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l']) - ;; 6-typing.watsup:926.1-928.22 - rule memory.fill {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:601.1-603.24 + rule br_if {C : context, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) + -- if (C.LABEL_context[l] = t*{t}) - ;; 6-typing.watsup:930.1-933.26 - rule memory.copy {C : context, mt_1 : memtype, mt_2 : memtype, x_1 : idx, x_2 : idx}: - `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x_1] = mt_1) - -- if (C.MEM_context[x_2] = mt_2) + ;; 6-typing.watsup:597.1-599.24 + rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- if (C.LABEL_context[l] = t*{t}) - ;; 6-typing.watsup:935.1-938.23 - rule memory.init {C : context, mt : memtype, x : idx, y : idx}: - `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (C.MEM_context[x] = mt) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:588.1-592.65 + rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) - ;; 6-typing.watsup:940.1-942.23 - rule data.drop {C : context, x : idx}: - `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) - -- if (C.DATA_context[x] = OK) + ;; 6-typing.watsup:583.1-586.61 + rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - ;; 6-typing.watsup:944.1-949.29 - rule load {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, x : idx, o0 : nat, o1? : nat?}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [$valtype_numtype(nt)])) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- (if ($size($valtype_numtype(nt)) = ?(o1)))?{o1} - -- if (C.MEM_context[x] = mt) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} - -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) + ;; 6-typing.watsup:578.1-581.61 + rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - ;; 6-typing.watsup:951.1-956.29 - rule store {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, x : idx, o0 : nat, o1? : nat?}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype $valtype_numtype(nt)], [])) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- (if ($size($valtype_numtype(nt)) = ?(o1)))?{o1} - -- if (C.MEM_context[x] = mt) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} - -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) + ;; 6-typing.watsup:557.1-560.37 + rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: + `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) + -- Valtype_sub: `%|-%<:%`(C, t, t') + -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) + + ;; 6-typing.watsup:554.1-555.31 + rule select-expl {C : context, t : valtype}: + `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) + + ;; 6-typing.watsup:550.1-551.23 + rule drop {C : context, t : valtype}: + `%|-%:%`(C, DROP_instr, `%->%`([t], [])) + + ;; 6-typing.watsup:547.1-548.24 + rule nop {C : context}: + `%|-%:%`(C, NOP_instr, `%->%`([], [])) + + ;; 6-typing.watsup:544.1-545.34 + rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) ;; 6-typing.watsup:504.1-504.67 relation Instrf_ok: `%|-%:%`(context, instr, instrtype) - ;; 6-typing.watsup:518.1-520.41 - rule instr {C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + ;; 6-typing.watsup:861.1-863.28 + rule local.tee {C : context, init : init, t : valtype, x : idx}: + `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) + -- if (C.LOCAL_context[x] = `%%`(init, t)) ;; 6-typing.watsup:857.1-859.28 rule local.set {C : context, init : init, t : valtype, x : idx}: `%|-%:%`(C, LOCAL.SET_instr(x), `%->%*%`([t], [x], [])) -- if (C.LOCAL_context[x] = `%%`(init, t)) - ;; 6-typing.watsup:861.1-863.28 - rule local.tee {C : context, init : init, t : valtype, x : idx}: - `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) - -- if (C.LOCAL_context[x] = `%%`(init, t)) + ;; 6-typing.watsup:518.1-520.41 + rule instr {C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) ;; 6-typing.watsup:505.1-505.74 relation Instrs_ok: `%|-%*:%`(context, instr*, instrtype) - ;; 6-typing.watsup:522.1-523.29 - rule empty {C : context}: - `%|-%*:%`(C, [], `%->%*%`([], [], [])) + ;; 6-typing.watsup:537.1-539.47 + rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%*:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + + ;; 6-typing.watsup:532.1-535.35 + rule sub {C : context, instr* : instr*, it : instrtype, it' : instrtype}: + `%|-%*:%`(C, instr*{instr}, it') + -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, it) + -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:525.1-530.52 rule seq {C : context, C' : context, init* : init*, instr_1 : instr, instr_2* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, x_1* : idx*, x_2* : idx*}: @@ -19277,16 +19427,9 @@ relation Instrs_ok: `%|-%*:%`(context, instr*, instrtype) -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) -- Instrs_ok: `%|-%*:%`(C', instr_2*{instr_2}, `%->%*%`(t_2*{t_2}, x_2*{x_2}, t_3*{t_3})) - ;; 6-typing.watsup:532.1-535.35 - rule sub {C : context, instr* : instr*, it : instrtype, it' : instrtype}: - `%|-%*:%`(C, instr*{instr}, it') - -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, it) - -- Instrtype_sub: `%|-%<:%`(C, it, it') - - ;; 6-typing.watsup:537.1-539.47 - rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%*:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:522.1-523.29 + rule empty {C : context}: + `%|-%*:%`(C, [], `%->%*%`([], [], [])) } ;; 6-typing.watsup:506.1-506.72 @@ -19301,10 +19444,10 @@ rec { ;; 6-typing.watsup:985.1-985.64 def in_binop : (binop_numtype, ibinop*) -> bool - ;; 6-typing.watsup:986.1-986.38 - def {binop : binop_numtype, epsilon : ibinop*} in_binop(binop, epsilon) = false ;; 6-typing.watsup:987.1-987.92 def {binop : binop_numtype, ibinop'* : ibinop*, ibinop_1 : ibinop} in_binop(binop, [ibinop_1] :: ibinop'*{ibinop'}) = ((binop = _I_binop_numtype(ibinop_1)) \/ $in_binop(binop, ibinop'*{ibinop'})) + ;; 6-typing.watsup:986.1-986.38 + def {binop : binop_numtype, epsilon : ibinop*} in_binop(binop, epsilon) = false } ;; 6-typing.watsup:981.1-981.63 @@ -19312,36 +19455,36 @@ rec { ;; 6-typing.watsup:981.1-981.63 def in_numtype : (numtype, numtype*) -> bool - ;; 6-typing.watsup:982.1-982.37 - def {epsilon : numtype*, nt : numtype} in_numtype(nt, epsilon) = false ;; 6-typing.watsup:983.1-983.68 def {nt : numtype, nt'* : numtype*, nt_1 : numtype} in_numtype(nt, [nt_1] :: nt'*{nt'}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt'})) + ;; 6-typing.watsup:982.1-982.37 + def {epsilon : numtype*, nt : numtype} in_numtype(nt, epsilon) = false } ;; 6-typing.watsup:963.1-963.78 relation Instr_const: `%|-%CONST`(context, instr) - ;; 6-typing.watsup:967.1-968.26 - rule const {C : context, c : c, nt : numtype}: - `%|-%CONST`(C, CONST_instr(nt, c)) + ;; 6-typing.watsup:989.1-992.38 + rule binop {C : context, binop : binop_numtype, nt : numtype}: + `%|-%CONST`(C, BINOP_instr(nt, binop)) + -- if $in_numtype(nt, [I32_numtype I64_numtype]) + -- if $in_binop(binop, [ADD_ibinop SUB_ibinop MUL_ibinop]) - ;; 6-typing.watsup:970.1-971.27 - rule ref.null {C : context, ht : heaptype}: - `%|-%CONST`(C, REF.NULL_instr(ht)) + ;; 6-typing.watsup:976.1-978.24 + rule global.get {C : context, t : valtype, x : idx}: + `%|-%CONST`(C, GLOBAL.GET_instr(x)) + -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?()), t)) ;; 6-typing.watsup:973.1-974.26 rule ref.func {C : context, x : idx}: `%|-%CONST`(C, REF.FUNC_instr(x)) - ;; 6-typing.watsup:976.1-978.24 - rule global.get {C : context, t : valtype, x : idx}: - `%|-%CONST`(C, GLOBAL.GET_instr(x)) - -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?()), t)) + ;; 6-typing.watsup:970.1-971.27 + rule ref.null {C : context, ht : heaptype}: + `%|-%CONST`(C, REF.NULL_instr(ht)) - ;; 6-typing.watsup:989.1-992.38 - rule binop {C : context, binop : binop_numtype, nt : numtype}: - `%|-%CONST`(C, BINOP_instr(nt, binop)) - -- if $in_numtype(nt, [I32_numtype I64_numtype]) - -- if $in_binop(binop, [ADD_ibinop SUB_ibinop MUL_ibinop]) + ;; 6-typing.watsup:967.1-968.26 + rule const {C : context, c : c, nt : numtype}: + `%|-%CONST`(C, CONST_instr(nt, c)) ;; 6-typing.watsup:964.1-964.77 relation Expr_const: `%|-%CONST`(context, expr) @@ -19369,16 +19512,16 @@ relation Type_ok: `%|-%:%*`(context, type, deftype*) ;; 6-typing.watsup:1013.1-1013.74 relation Local_ok: `%|-%:%`(context, local, localtype) - ;; 6-typing.watsup:1029.1-1031.28 - rule set {C : context, t : valtype}: - `%|-%:%`(C, LOCAL(t), `%%`(SET_init, t)) - -- if ($default(t) =/= ?()) - ;; 6-typing.watsup:1033.1-1035.26 rule unset {C : context, t : valtype}: `%|-%:%`(C, LOCAL(t), `%%`(UNSET_init, t)) -- if ($default(t) = ?()) + ;; 6-typing.watsup:1029.1-1031.28 + rule set {C : context, t : valtype}: + `%|-%:%`(C, LOCAL(t), `%%`(SET_init, t)) + -- if ($default(t) =/= ?()) + ;; 6-typing.watsup:1012.1-1012.73 relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup:1037.1-1041.82 @@ -19415,19 +19558,19 @@ relation Mem_ok: `%|-%:%`(context, mem, memtype) ;; 6-typing.watsup:1019.1-1019.77 relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) - ;; 6-typing.watsup:1068.1-1071.45 - rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} + ;; 6-typing.watsup:1076.1-1077.20 + rule declare {C : context, rt : reftype}: + `%|-%:%`(C, DECLARE_elemmode, rt) ;; 6-typing.watsup:1073.1-1074.20 rule passive {C : context, rt : reftype}: `%|-%:%`(C, PASSIVE_elemmode, rt) - ;; 6-typing.watsup:1076.1-1077.20 - rule declare {C : context, rt : reftype}: - `%|-%:%`(C, DECLARE_elemmode, rt) + ;; 6-typing.watsup:1068.1-1071.45 + rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} ;; 6-typing.watsup:1017.1-1017.73 relation Elem_ok: `%|-%:%`(context, elem, reftype) @@ -19439,16 +19582,16 @@ relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup:1020.1-1020.77 relation Datamode_ok: `%|-%:OK`(context, datamode) + ;; 6-typing.watsup:1084.1-1085.20 + rule passive {C : context}: + `%|-%:OK`(C, PASSIVE_datamode) + ;; 6-typing.watsup:1079.1-1082.45 rule active {C : context, expr : expr, mt : memtype, x : idx}: `%|-%:OK`(C, ACTIVE_datamode(x, expr)) -- if (C.MEM_context[x] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 6-typing.watsup:1084.1-1085.20 - rule passive {C : context}: - `%|-%:OK`(C, PASSIVE_datamode) - ;; 6-typing.watsup:1018.1-1018.73 relation Data_ok: `%|-%:OK`(context, data) ;; 6-typing.watsup:1064.1-1066.37 @@ -19472,25 +19615,25 @@ relation Import_ok: `%|-%:%`(context, import, externtype) ;; 6-typing.watsup:1096.1-1096.83 relation Externidx_ok: `%|-%:%`(context, externidx, externtype) - ;; 6-typing.watsup:1107.1-1109.23 - rule func {C : context, dt : deftype, x : idx}: - `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) - -- if (C.FUNC_context[x] = dt) - - ;; 6-typing.watsup:1111.1-1113.25 - rule global {C : context, gt : globaltype, x : idx}: - `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) - -- if (C.GLOBAL_context[x] = gt) + ;; 6-typing.watsup:1119.1-1121.22 + rule mem {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) + -- if (C.MEM_context[x] = mt) ;; 6-typing.watsup:1115.1-1117.24 rule table {C : context, tt : tabletype, x : idx}: `%|-%:%`(C, TABLE_externidx(x), TABLE_externtype(tt)) -- if (C.TABLE_context[x] = tt) - ;; 6-typing.watsup:1119.1-1121.22 - rule mem {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:1111.1-1113.25 + rule global {C : context, gt : globaltype, x : idx}: + `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) + -- if (C.GLOBAL_context[x] = gt) + + ;; 6-typing.watsup:1107.1-1109.23 + rule func {C : context, dt : deftype, x : idx}: + `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) + -- if (C.FUNC_context[x] = dt) ;; 6-typing.watsup:1095.1-1095.80 relation Export_ok: `%|-%:%`(context, export, externtype) @@ -19504,15 +19647,15 @@ rec { ;; 6-typing.watsup:1128.1-1128.77 relation Globals_ok: `%|-%*:%*`(context, global*, globaltype*) - ;; 6-typing.watsup:1171.1-1172.17 - rule empty {C : context}: - `%|-%*:%*`(C, [], []) - ;; 6-typing.watsup:1174.1-1177.54 rule cons {C : context, global : global, global_1 : global, gt* : globaltype*, gt_1 : globaltype}: `%|-%*:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt}) -- Global_ok: `%|-%:%`(C, global, gt_1) -- Globals_ok: `%|-%*:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt}) + + ;; 6-typing.watsup:1171.1-1172.17 + rule empty {C : context}: + `%|-%*:%*`(C, [], []) } ;; 6-typing.watsup:1127.1-1127.75 @@ -19520,15 +19663,15 @@ rec { ;; 6-typing.watsup:1127.1-1127.75 relation Types_ok: `%|-%*:%*`(context, type*, deftype*) - ;; 6-typing.watsup:1163.1-1164.17 - rule empty {C : context}: - `%|-%*:%*`(C, [], []) - ;; 6-typing.watsup:1166.1-1169.49 rule cons {C : context, dt* : deftype*, dt_1 : deftype, type* : type*, type_1 : type}: `%|-%*:%*`(C, [type_1] :: type*{type}, dt_1*{} :: dt*{dt}) -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) -- Types_ok: `%|-%*:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, dt*{dt}) + + ;; 6-typing.watsup:1163.1-1164.17 + rule empty {C : context}: + `%|-%*:%*`(C, [], []) } ;; 6-typing.watsup:1126.1-1126.76 @@ -19555,475 +19698,489 @@ relation Module_ok: `|-%:OK`(module) ;; 7-runtime-typing.watsup:5.1-5.40 relation Ref_ok: `%|-%:%`(store, ref, reftype) - ;; 7-runtime-typing.watsup:7.1-8.35 - rule null {ht : heaptype, s : store}: - `%|-%:%`(s, REF.NULL_ref(ht), REF_reftype(`NULL%?`(?(())), ht)) + ;; 7-runtime-typing.watsup:28.1-29.45 + rule extern {addrref : addrref, s : store}: + `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) - ;; 7-runtime-typing.watsup:10.1-11.37 - rule i31 {i : nat, s : store}: - `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) + ;; 7-runtime-typing.watsup:25.1-26.39 + rule host {a : addr, s : store}: + `%|-%:%`(s, REF.HOST_ADDR_ref(a), REF_reftype(`NULL%?`(?()), ANY_heaptype)) - ;; 7-runtime-typing.watsup:13.1-15.30 - rule struct {a : addr, dt : deftype, s : store}: - `%|-%:%`(s, REF.STRUCT_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) - -- if (s.STRUCT_store[a].TYPE_structinst = dt) + ;; 7-runtime-typing.watsup:21.1-23.28 + rule func {a : addr, dt : deftype, s : store}: + `%|-%:%`(s, REF.FUNC_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) + -- if (s.FUNC_store[a].TYPE_funcinst = dt) ;; 7-runtime-typing.watsup:17.1-19.29 rule array {a : addr, dt : deftype, s : store}: `%|-%:%`(s, REF.ARRAY_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) -- if (s.ARRAY_store[a].TYPE_arrayinst = dt) - ;; 7-runtime-typing.watsup:21.1-23.28 - rule func {a : addr, dt : deftype, s : store}: - `%|-%:%`(s, REF.FUNC_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) - -- if (s.FUNC_store[a].TYPE_funcinst = dt) + ;; 7-runtime-typing.watsup:13.1-15.30 + rule struct {a : addr, dt : deftype, s : store}: + `%|-%:%`(s, REF.STRUCT_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) + -- if (s.STRUCT_store[a].TYPE_structinst = dt) - ;; 7-runtime-typing.watsup:25.1-26.39 - rule host {a : addr, s : store}: - `%|-%:%`(s, REF.HOST_ADDR_ref(a), REF_reftype(`NULL%?`(?()), ANY_heaptype)) + ;; 7-runtime-typing.watsup:10.1-11.37 + rule i31 {i : nat, s : store}: + `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) - ;; 7-runtime-typing.watsup:28.1-29.45 - rule extern {addrref : addrref, s : store}: - `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) + ;; 7-runtime-typing.watsup:7.1-8.35 + rule null {ht : heaptype, s : store}: + `%|-%:%`(s, REF.NULL_ref(ht), REF_reftype(`NULL%?`(?(())), ht)) ;; 8-reduction.watsup:6.1-6.63 relation Step_pure: `%*~>%*`(admininstr*, admininstr*) - ;; 8-reduction.watsup:42.1-43.24 - rule unreachable: - `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) + ;; 8-reduction.watsup:552.1-553.47 + rule local.tee {val : val, x : idx}: + `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) - ;; 8-reduction.watsup:45.1-46.15 - rule nop: - `%*~>%*`([NOP_admininstr], []) + ;; 8-reduction.watsup:539.1-540.55 + rule any.convert_extern-addr {addrref : addrref}: + `%*~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [$admininstr_addrref(addrref)]) - ;; 8-reduction.watsup:48.1-49.20 - rule drop {val : val}: - `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) + ;; 8-reduction.watsup:536.1-537.55 + rule any.convert_extern-null {ht : heaptype}: + `%*~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) - ;; 8-reduction.watsup:52.1-54.16 - rule select-true {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: - `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_1)]) - -- if (c =/= 0) - - ;; 8-reduction.watsup:56.1-58.14 - rule select-false {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: - `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_2)]) - -- if (c = 0) - - ;; 8-reduction.watsup:76.1-78.16 - rule if-true {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) - -- if (c =/= 0) - - ;; 8-reduction.watsup:80.1-82.14 - rule if-false {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) - -- if (c = 0) + ;; 8-reduction.watsup:532.1-533.55 + rule extern.convert_any-addr {addrref : addrref}: + `%*~>%*`([$admininstr_addrref(addrref) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) - ;; 8-reduction.watsup:85.1-86.38 - rule label-vals {instr* : instr*, n : n, val* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) + ;; 8-reduction.watsup:529.1-530.58 + rule extern.convert_any-null {ht : heaptype}: + `%*~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) - ;; 8-reduction.watsup:92.1-93.69 - rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) + ;; 8-reduction.watsup:311.1-312.68 + rule i31.get-num {i : nat, sx : sx}: + `%*~>%*`([REF.I31_NUM_admininstr(i) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, i))]) - ;; 8-reduction.watsup:95.1-96.65 - rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) + ;; 8-reduction.watsup:308.1-309.39 + rule i31.get-null {ht : heaptype, sx : sx}: + `%*~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) - ;; 8-reduction.watsup:99.1-101.16 - rule br_if-true {c : c, l : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) - -- if (c =/= 0) + ;; 8-reduction.watsup:281.1-283.15 + rule ref.eq-false {ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 0)]) + -- otherwise - ;; 8-reduction.watsup:103.1-105.14 - rule br_if-false {c : c, l : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) - -- if (c = 0) + ;; 8-reduction.watsup:276.1-279.22 + rule ref.eq-true {ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- otherwise + -- if (ref_1 = ref_2) - ;; 8-reduction.watsup:108.1-110.17 - rule br_table-lt {i : nat, l* : labelidx*, l' : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) - -- if (i < |l*{l}|) + ;; 8-reduction.watsup:272.1-274.55 + rule ref.eq-null {ht_1 : heaptype, ht_2 : heaptype, ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) - ;; 8-reduction.watsup:112.1-114.18 - rule br_table-ge {i : nat, l* : labelidx*, l' : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) - -- if (i >= |l*{l}|) + ;; 8-reduction.watsup:267.1-269.15 + rule ref.as_non_null-addr {ref : ref}: + `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [$admininstr_ref(ref)]) + -- otherwise - ;; 8-reduction.watsup:117.1-119.26 - rule br_on_null-null {ht : heaptype, l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) - -- if (val = REF.NULL_val(ht)) + ;; 8-reduction.watsup:263.1-265.28 + rule ref.as_non_null-null {ht : heaptype, ref : ref}: + `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) + -- if (ref = REF.NULL_ref(ht)) - ;; 8-reduction.watsup:121.1-123.15 - rule br_on_null-addr {l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [$admininstr_val(val)]) + ;; 8-reduction.watsup:258.1-260.15 + rule ref.is_null-false {val : val}: + `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 8-reduction.watsup:126.1-128.26 - rule br_on_non_null-null {ht : heaptype, l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], []) + ;; 8-reduction.watsup:254.1-256.28 + rule ref.is_null-true {ht : heaptype, val : val}: + `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:130.1-132.15 - rule br_on_non_null-addr {l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], [$admininstr_val(val) BR_admininstr(l)]) - -- otherwise - - ;; 8-reduction.watsup:186.1-187.84 - rule call_indirect-call {x : idx, y : idx}: - `%*~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) CALL_REF_admininstr(?(y))]) + ;; 8-reduction.watsup:250.1-251.60 + rule ref.i31 {i : nat}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, i))]) - ;; 8-reduction.watsup:189.1-190.98 - rule return_call_indirect {x : idx, y : idx}: - `%*~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) RETURN_CALL_REF_admininstr(?(y))]) + ;; 8-reduction.watsup:240.1-242.50 + rule cvtop-trap {c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: + `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) + -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = []) - ;; 8-reduction.watsup:193.1-194.35 - rule frame-vals {f : frame, n : n, val^n : val^n}: - `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) + ;; 8-reduction.watsup:236.1-238.48 + rule cvtop-val {c : c, c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: + `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) + -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = [c]) - ;; 8-reduction.watsup:196.1-197.55 - rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: - `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) + ;; 8-reduction.watsup:232.1-233.70 + rule extend {c : c, n : n, nt : numtype, o0 : nat}: + `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, o0, S_sx, c))]) + -- if ($size($valtype_numtype(nt)) = ?(o0)) - ;; 8-reduction.watsup:199.1-200.60 - rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: - `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) + ;; 8-reduction.watsup:227.1-229.40 + rule relop {c : c, c_1 : c, c_2 : c, nt : numtype, relop : relop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) + -- if (c = $relop(relop, nt, c_1, c_2)) - ;; 8-reduction.watsup:205.1-207.33 - rule unop-val {c : c, c_1 : c, nt : numtype, unop : unop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) - -- if ($unop(unop, nt, c_1) = [c]) + ;; 8-reduction.watsup:223.1-225.37 + rule testop {c : c, c_1 : c, nt : numtype, testop : testop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) + -- if (c = $testop(testop, nt, c_1)) - ;; 8-reduction.watsup:209.1-211.35 - rule unop-trap {c_1 : c, nt : numtype, unop : unop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) - -- if ($unop(unop, nt, c_1) = []) + ;; 8-reduction.watsup:218.1-220.42 + rule binop-trap {binop : binop_numtype, c_1 : c, c_2 : c, nt : numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) + -- if ($binop(binop, nt, c_1, c_2) = []) ;; 8-reduction.watsup:214.1-216.40 rule binop-val {binop : binop_numtype, c : c, c_1 : c, c_2 : c, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- if ($binop(binop, nt, c_1, c_2) = [c]) - ;; 8-reduction.watsup:218.1-220.42 - rule binop-trap {binop : binop_numtype, c_1 : c, c_2 : c, nt : numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) - -- if ($binop(binop, nt, c_1, c_2) = []) - - ;; 8-reduction.watsup:223.1-225.37 - rule testop {c : c, c_1 : c, nt : numtype, testop : testop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) - -- if (c = $testop(testop, nt, c_1)) + ;; 8-reduction.watsup:209.1-211.35 + rule unop-trap {c_1 : c, nt : numtype, unop : unop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) + -- if ($unop(unop, nt, c_1) = []) - ;; 8-reduction.watsup:227.1-229.40 - rule relop {c : c, c_1 : c, c_2 : c, nt : numtype, relop : relop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) - -- if (c = $relop(relop, nt, c_1, c_2)) + ;; 8-reduction.watsup:205.1-207.33 + rule unop-val {c : c, c_1 : c, nt : numtype, unop : unop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) + -- if ($unop(unop, nt, c_1) = [c]) - ;; 8-reduction.watsup:232.1-233.70 - rule extend {c : c, n : n, nt : numtype, o0 : nat}: - `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, o0, S_sx, c))]) - -- if ($size($valtype_numtype(nt)) = ?(o0)) + ;; 8-reduction.watsup:199.1-200.60 + rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: + `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) - ;; 8-reduction.watsup:236.1-238.48 - rule cvtop-val {c : c, c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: - `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) - -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = [c]) + ;; 8-reduction.watsup:196.1-197.55 + rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: + `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) - ;; 8-reduction.watsup:240.1-242.50 - rule cvtop-trap {c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: - `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) - -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = []) + ;; 8-reduction.watsup:193.1-194.35 + rule frame-vals {f : frame, n : n, val^n : val^n}: + `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) - ;; 8-reduction.watsup:250.1-251.60 - rule ref.i31 {i : nat}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, i))]) + ;; 8-reduction.watsup:189.1-190.98 + rule return_call_indirect {x : idx, y : idx}: + `%*~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) RETURN_CALL_REF_admininstr(?(y))]) - ;; 8-reduction.watsup:254.1-256.28 - rule ref.is_null-true {ht : heaptype, val : val}: - `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- if (val = REF.NULL_val(ht)) + ;; 8-reduction.watsup:186.1-187.84 + rule call_indirect-call {x : idx, y : idx}: + `%*~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) CALL_REF_admininstr(?(y))]) - ;; 8-reduction.watsup:258.1-260.15 - rule ref.is_null-false {val : val}: - `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) + ;; 8-reduction.watsup:130.1-132.15 + rule br_on_non_null-addr {l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], [$admininstr_val(val) BR_admininstr(l)]) -- otherwise - ;; 8-reduction.watsup:263.1-265.28 - rule ref.as_non_null-null {ht : heaptype, ref : ref}: - `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) - -- if (ref = REF.NULL_ref(ht)) + ;; 8-reduction.watsup:126.1-128.26 + rule br_on_non_null-null {ht : heaptype, l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], []) + -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:267.1-269.15 - rule ref.as_non_null-addr {ref : ref}: - `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [$admininstr_ref(ref)]) + ;; 8-reduction.watsup:121.1-123.15 + rule br_on_null-addr {l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [$admininstr_val(val)]) -- otherwise - ;; 8-reduction.watsup:272.1-274.55 - rule ref.eq-null {ht_1 : heaptype, ht_2 : heaptype, ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) - - ;; 8-reduction.watsup:276.1-279.22 - rule ref.eq-true {ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- otherwise - -- if (ref_1 = ref_2) + ;; 8-reduction.watsup:117.1-119.26 + rule br_on_null-null {ht : heaptype, l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) + -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:281.1-283.15 - rule ref.eq-false {ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 0)]) - -- otherwise + ;; 8-reduction.watsup:112.1-114.18 + rule br_table-ge {i : nat, l* : labelidx*, l' : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) + -- if (i >= |l*{l}|) - ;; 8-reduction.watsup:308.1-309.39 - rule i31.get-null {ht : heaptype, sx : sx}: - `%*~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) + ;; 8-reduction.watsup:108.1-110.17 + rule br_table-lt {i : nat, l* : labelidx*, l' : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) + -- if (i < |l*{l}|) - ;; 8-reduction.watsup:311.1-312.68 - rule i31.get-num {i : nat, sx : sx}: - `%*~>%*`([REF.I31_NUM_admininstr(i) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, i))]) + ;; 8-reduction.watsup:103.1-105.14 + rule br_if-false {c : c, l : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) + -- if (c = 0) - ;; 8-reduction.watsup:529.1-530.58 - rule extern.convert_any-null {ht : heaptype}: - `%*~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) + ;; 8-reduction.watsup:99.1-101.16 + rule br_if-true {c : c, l : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) + -- if (c =/= 0) - ;; 8-reduction.watsup:532.1-533.55 - rule extern.convert_any-addr {addrref : addrref}: - `%*~>%*`([$admininstr_addrref(addrref) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) + ;; 8-reduction.watsup:95.1-96.65 + rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) - ;; 8-reduction.watsup:536.1-537.55 - rule any.convert_extern-null {ht : heaptype}: - `%*~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) + ;; 8-reduction.watsup:92.1-93.69 + rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) - ;; 8-reduction.watsup:539.1-540.55 - rule any.convert_extern-addr {addrref : addrref}: - `%*~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [$admininstr_addrref(addrref)]) + ;; 8-reduction.watsup:85.1-86.38 + rule label-vals {instr* : instr*, n : n, val* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) - ;; 8-reduction.watsup:552.1-553.47 - rule local.tee {val : val, x : idx}: - `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) + ;; 8-reduction.watsup:80.1-82.14 + rule if-false {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) + -- if (c = 0) + + ;; 8-reduction.watsup:76.1-78.16 + rule if-true {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) + -- if (c =/= 0) + + ;; 8-reduction.watsup:56.1-58.14 + rule select-false {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: + `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_2)]) + -- if (c = 0) + + ;; 8-reduction.watsup:52.1-54.16 + rule select-true {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: + `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_1)]) + -- if (c =/= 0) + + ;; 8-reduction.watsup:48.1-49.20 + rule drop {val : val}: + `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) + + ;; 8-reduction.watsup:45.1-46.15 + rule nop: + `%*~>%*`([NOP_admininstr], []) + + ;; 8-reduction.watsup:42.1-43.24 + rule unreachable: + `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) ;; 8-reduction.watsup:63.1-63.73 def blocktype : (state, blocktype) -> functype - ;; 8-reduction.watsup:64.1-64.44 - def {z : state} blocktype(z, _RESULT_blocktype(?())) = `%->%`([], []) - ;; 8-reduction.watsup:65.1-65.40 - def {t : valtype, z : state} blocktype(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) ;; 8-reduction.watsup:66.1-66.66 def {ft : functype, x : idx, z : state} blocktype(z, _IDX_blocktype(x)) = ft -- Expand: `%~~%`($type(z, x), FUNC_comptype(ft)) + ;; 8-reduction.watsup:65.1-65.40 + def {t : valtype, z : state} blocktype(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) + ;; 8-reduction.watsup:64.1-64.44 + def {z : state} blocktype(z, _RESULT_blocktype(?())) = `%->%`([], []) ;; 8-reduction.watsup:7.1-7.63 relation Step_read: `%~>%*`(config, admininstr*) - ;; 8-reduction.watsup:68.1-70.43 - rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + ;; 8-reduction.watsup:753.1-757.15 + rule memory.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, y).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x, y)]) + -- otherwise - ;; 8-reduction.watsup:72.1-74.43 - rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + ;; 8-reduction.watsup:748.1-751.14 + rule memory.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:135.1-138.66 - rule br_on_cast-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt) - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) + ;; 8-reduction.watsup:744.1-746.70 + rule memory.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) - ;; 8-reduction.watsup:140.1-142.15 - rule br_on_cast-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) + ;; 8-reduction.watsup:737.1-741.15 + rule memory.copy-gt {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise - ;; 8-reduction.watsup:145.1-148.66 - rule br_on_cast_fail-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt) - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) + ;; 8-reduction.watsup:730.1-735.19 + rule memory.copy-le {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, (i_1 + 1)) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) + -- otherwise + -- if (i_1 <= i_2) - ;; 8-reduction.watsup:150.1-152.15 - rule br_on_cast_fail-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) + ;; 8-reduction.watsup:725.1-728.14 + rule memory.copy-zero {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), []) -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:157.1-158.62 - rule call {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) CALL_REF_admininstr(?())]) + ;; 8-reduction.watsup:721.1-723.77 + rule memory.copy-oob {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) - ;; 8-reduction.watsup:160.1-161.43 - rule call_ref-null {ht : heaptype, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) + ;; 8-reduction.watsup:714.1-718.15 + rule memory.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr(x)]) + -- otherwise - ;; 8-reduction.watsup:163.1-168.59 - rule call_ref-func {a : addr, f : frame, fi : funcinst, instr* : instr*, m : m, n : n, t* : valtype*, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, x? : idx?, y : idx, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], $admininstr_instr(instr)*{instr})])]) - -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) - -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) + ;; 8-reduction.watsup:709.1-712.14 + rule memory.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:171.1-172.76 - rule return_call {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) RETURN_CALL_REF_admininstr(?())]) + ;; 8-reduction.watsup:705.1-707.37 + rule memory.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:175.1-176.78 - rule return_call_ref-frame-null {f : frame, ht : heaptype, instr* : instr*, k : nat, val* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), [TRAP_admininstr]) + ;; 8-reduction.watsup:692.1-694.44 + rule memory.size {n : n, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) + -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:178.1-180.59 - rule return_call_ref-frame-addr {a : addr, f : frame, instr* : instr*, k : nat, m : m, n : n, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, val'* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + ;; 8-reduction.watsup:670.1-672.61 + rule load-pack-val {c : c, i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state, o0 : nat}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [CONST_admininstr(nt, $ext(n, o0, sx, c))]) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) - ;; 8-reduction.watsup:182.1-183.91 - rule return_call_ref-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) + ;; 8-reduction.watsup:666.1-668.51 + rule load-pack-oob {i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [TRAP_admininstr]) + -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:247.1-248.55 - rule ref.func {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) + ;; 8-reduction.watsup:662.1-664.71 + rule load-num-val {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (o0 / 8)]) - ;; 8-reduction.watsup:286.1-289.65 - rule ref.test-true {ref : ref, rt : reftype, rt' : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 1)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt') - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) + ;; 8-reduction.watsup:658.1-660.59 + rule load-num-oob {i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if (((i + mo.OFFSET_memop) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:291.1-293.15 - rule ref.test-false {ref : ref, rt : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 0)]) + ;; 8-reduction.watsup:645.1-649.15 + rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.INIT_admininstr(x, y)]) -- otherwise - ;; 8-reduction.watsup:296.1-299.65 - rule ref.cast-succeed {ref : ref, rt : reftype, rt' : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [$admininstr_ref(ref)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt') - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) - - ;; 8-reduction.watsup:301.1-303.15 - rule ref.cast-fail {ref : ref, rt : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:640.1-643.14 + rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), []) -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:322.1-325.43 - rule struct.new_default {mut* : mut*, val* : val*, x : idx, z : state, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)*{val} :: [STRUCT.NEW_admininstr(x)]) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} - - ;; 8-reduction.watsup:328.1-329.50 - rule struct.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:636.1-638.72 + rule table.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) - ;; 8-reduction.watsup:331.1-334.41 - rule struct.get-struct {a : addr, i : nat, mut* : mut*, si : structinst, sx? : sx?, x : idx, z : state, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [$admininstr_val($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]))]) - -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + ;; 8-reduction.watsup:629.1-633.15 + rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) + -- otherwise - ;; 8-reduction.watsup:348.1-349.70 - rule array.new {n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.NEW_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + ;; 8-reduction.watsup:622.1-627.15 + rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) + -- otherwise + -- if (j <= i) - ;; 8-reduction.watsup:351.1-354.40 - rule array.new_default {mut : mut, n : n, val : val, x : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) ARRAY.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ($default($unpacktype(zt)) = ?(val)) + ;; 8-reduction.watsup:617.1-620.14 + rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:362.1-364.38 - rule array.new_elem-oob {i : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) + ;; 8-reduction.watsup:613.1-615.73 + rule table.copy-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) - ;; 8-reduction.watsup:366.1-368.40 - rule array.new_elem-alloc {i : nat, n : n, ref^n : ref^n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), $admininstr_ref(ref)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) - - ;; 8-reduction.watsup:371.1-374.59 - rule array.new_data-oob {i : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) + ;; 8-reduction.watsup:606.1-610.15 + rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) + -- otherwise - ;; 8-reduction.watsup:376.1-380.88 - rule array.new_data-alloc {c^n : c^n, i : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (nt = $unpacknumtype(zt)) - -- if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) + ;; 8-reduction.watsup:601.1-604.14 + rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:383.1-384.61 - rule array.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:597.1-599.39 + rule table.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:386.1-388.38 - rule array.get-oob {a : addr, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) - -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:584.1-586.32 + rule table.size {n : n, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) + -- if (|$table(z, x).ELEM_tableinst| = n) - ;; 8-reduction.watsup:390.1-393.53 - rule array.get-array {a : addr, fv : fieldval, i : nat, mut : mut, sx? : sx?, x : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [$admininstr_val($unpackval(zt, sx?{sx}, fv))]) - -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) - -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) + ;; 8-reduction.watsup:571.1-573.32 + rule table.get-val {i : nat, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) + -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:409.1-410.39 - rule array.len-null {ht : heaptype, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) + ;; 8-reduction.watsup:567.1-569.33 + rule table.get-oob {i : nat, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) + -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:412.1-414.37 - rule array.len-array {a : addr, n : n, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, n)]) - -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:558.1-559.45 + rule global.get {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) - ;; 8-reduction.watsup:417.1-418.76 - rule array.fill-null {ht : heaptype, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:545.1-547.27 + rule local.get {val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val(val)]) + -- if ($local(z, x) = ?(val)) - ;; 8-reduction.watsup:420.1-422.44 - rule array.fill-oob {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:517.1-524.67 + rule array.init_data-succ {a : addr, c : c, i : nat, j : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + ($storagesize(zt) / 8))) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_DATA_admininstr(x, y)]) + -- otherwise + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (nt = $unpacknumtype(zt)) + -- if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) - ;; 8-reduction.watsup:424.1-427.14 - rule array.fill-zero {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), []) + ;; 8-reduction.watsup:512.1-515.14 + rule array.init_data-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), []) -- otherwise -- if (n = 0) - ;; 8-reduction.watsup:429.1-433.15 - rule array.fill-succ {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.FILL_admininstr(x)]) + ;; 8-reduction.watsup:507.1-510.59 + rule array.init_data-oob2 {a : addr, i : nat, j : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) + + ;; 8-reduction.watsup:503.1-505.44 + rule array.init_data-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) + + ;; 8-reduction.watsup:500.1-501.93 + rule array.init_data-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + + ;; 8-reduction.watsup:492.1-497.34 + rule array.init_elem-succ {a : addr, i : nat, j : nat, n : n, ref : ref, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_ELEM_admininstr(x, y)]) -- otherwise + -- if (ref = $elem(z, y).ELEM_eleminst[j]) - ;; 8-reduction.watsup:435.1-436.102 - rule array.copy-null1 {ht_1 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, i_1) $admininstr_ref(ref) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:487.1-490.14 + rule array.init_elem-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:438.1-439.102 - rule array.copy-null2 {ht_2 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, i_1) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:483.1-485.38 + rule array.init_elem-oob2 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) - ;; 8-reduction.watsup:441.1-443.48 - rule array.copy-oob1 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) + ;; 8-reduction.watsup:479.1-481.44 + rule array.init_elem-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:445.1-447.48 - rule array.copy-oob2 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) + ;; 8-reduction.watsup:476.1-477.93 + rule array.init_elem-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:449.1-452.14 - rule array.copy-zero {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), []) + ;; 8-reduction.watsup:465.1-473.29 + rule array.copy-gt {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise - -- if (n = 0) + -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) + -- if (sx?{sx} = $sxfield(zt_2)) ;; 8-reduction.watsup:454.1-463.19 rule array.copy-le {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: @@ -20033,360 +20190,346 @@ relation Step_read: `%~>%*`(config, admininstr*) -- if (sx?{sx} = $sxfield(zt_2)) -- if (i_1 <= i_2) - ;; 8-reduction.watsup:465.1-473.29 - rule array.copy-gt {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) + ;; 8-reduction.watsup:449.1-452.14 + rule array.copy-zero {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), []) -- otherwise - -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (n = 0) - ;; 8-reduction.watsup:476.1-477.93 - rule array.init_elem-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:445.1-447.48 + rule array.copy-oob2 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) - ;; 8-reduction.watsup:479.1-481.44 - rule array.init_elem-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:441.1-443.48 + rule array.copy-oob1 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) - ;; 8-reduction.watsup:483.1-485.38 - rule array.init_elem-oob2 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) + ;; 8-reduction.watsup:438.1-439.102 + rule array.copy-null2 {ht_2 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, i_1) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:487.1-490.14 - rule array.init_elem-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:435.1-436.102 + rule array.copy-null1 {ht_1 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, i_1) $admininstr_ref(ref) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:492.1-497.34 - rule array.init_elem-succ {a : addr, i : nat, j : nat, n : n, ref : ref, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_ELEM_admininstr(x, y)]) + ;; 8-reduction.watsup:429.1-433.15 + rule array.fill-succ {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.FILL_admininstr(x)]) -- otherwise - -- if (ref = $elem(z, y).ELEM_eleminst[j]) - - ;; 8-reduction.watsup:500.1-501.93 - rule array.init_data-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - - ;; 8-reduction.watsup:503.1-505.44 - rule array.init_data-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - - ;; 8-reduction.watsup:507.1-510.59 - rule array.init_data-oob2 {a : addr, i : nat, j : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) - ;; 8-reduction.watsup:512.1-515.14 - rule array.init_data-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), []) + ;; 8-reduction.watsup:424.1-427.14 + rule array.fill-zero {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), []) -- otherwise -- if (n = 0) - ;; 8-reduction.watsup:517.1-524.67 - rule array.init_data-succ {a : addr, c : c, i : nat, j : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + ($storagesize(zt) / 8))) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_DATA_admininstr(x, y)]) - -- otherwise - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (nt = $unpacknumtype(zt)) - -- if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) + ;; 8-reduction.watsup:420.1-422.44 + rule array.fill-oob {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:545.1-547.27 - rule local.get {val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val(val)]) - -- if ($local(z, x) = ?(val)) + ;; 8-reduction.watsup:417.1-418.76 + rule array.fill-null {ht : heaptype, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:558.1-559.45 - rule global.get {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) + ;; 8-reduction.watsup:412.1-414.37 + rule array.len-array {a : addr, n : n, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, n)]) + -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:567.1-569.33 - rule table.get-oob {i : nat, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) - -- if (i >= |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:409.1-410.39 + rule array.len-null {ht : heaptype, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) - ;; 8-reduction.watsup:571.1-573.32 - rule table.get-val {i : nat, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) - -- if (i < |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:390.1-393.53 + rule array.get-array {a : addr, fv : fieldval, i : nat, mut : mut, sx? : sx?, x : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [$admininstr_val($unpackval(zt, sx?{sx}, fv))]) + -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) + -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) - ;; 8-reduction.watsup:584.1-586.32 - rule table.size {n : n, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) - -- if (|$table(z, x).ELEM_tableinst| = n) + ;; 8-reduction.watsup:386.1-388.38 + rule array.get-oob {a : addr, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:597.1-599.39 - rule table.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:383.1-384.61 + rule array.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:601.1-604.14 - rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:376.1-380.88 + rule array.new_data-alloc {c^n : c^n, i : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (nt = $unpacknumtype(zt)) + -- if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) - ;; 8-reduction.watsup:606.1-610.15 - rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) - -- otherwise + ;; 8-reduction.watsup:371.1-374.59 + rule array.new_data-oob {i : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) - ;; 8-reduction.watsup:613.1-615.73 - rule table.copy-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) + ;; 8-reduction.watsup:366.1-368.40 + rule array.new_elem-alloc {i : nat, n : n, ref^n : ref^n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), $admininstr_ref(ref)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) - ;; 8-reduction.watsup:617.1-620.14 - rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:362.1-364.38 + rule array.new_elem-oob {i : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) - ;; 8-reduction.watsup:622.1-627.15 - rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) - -- otherwise - -- if (j <= i) + ;; 8-reduction.watsup:351.1-354.40 + rule array.new_default {mut : mut, n : n, val : val, x : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) ARRAY.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ($default($unpacktype(zt)) = ?(val)) - ;; 8-reduction.watsup:629.1-633.15 - rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) - -- otherwise + ;; 8-reduction.watsup:348.1-349.70 + rule array.new {n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.NEW_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - ;; 8-reduction.watsup:636.1-638.72 - rule table.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) + ;; 8-reduction.watsup:331.1-334.41 + rule struct.get-struct {a : addr, i : nat, mut* : mut*, si : structinst, sx? : sx?, x : idx, z : state, zt* : storagetype*}: + `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [$admininstr_val($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]))]) + -- if ($structinst(z)[a] = si) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - ;; 8-reduction.watsup:640.1-643.14 - rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), []) + ;; 8-reduction.watsup:328.1-329.50 + rule struct.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [TRAP_admininstr]) + + ;; 8-reduction.watsup:322.1-325.43 + rule struct.new_default {mut* : mut*, val* : val*, x : idx, z : state, zt* : storagetype*}: + `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)*{val} :: [STRUCT.NEW_admininstr(x)]) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} + + ;; 8-reduction.watsup:301.1-303.15 + rule ref.cast-fail {ref : ref, rt : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) -- otherwise - -- if (n = 0) - ;; 8-reduction.watsup:645.1-649.15 - rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.INIT_admininstr(x, y)]) + ;; 8-reduction.watsup:296.1-299.65 + rule ref.cast-succeed {ref : ref, rt : reftype, rt' : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [$admininstr_ref(ref)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt') + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) + + ;; 8-reduction.watsup:291.1-293.15 + rule ref.test-false {ref : ref, rt : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 8-reduction.watsup:658.1-660.59 - rule load-num-oob {i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if (((i + mo.OFFSET_memop) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:286.1-289.65 + rule ref.test-true {ref : ref, rt : reftype, rt' : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 1)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt') + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) - ;; 8-reduction.watsup:662.1-664.71 - rule load-num-val {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (o0 / 8)]) + ;; 8-reduction.watsup:247.1-248.55 + rule ref.func {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) - ;; 8-reduction.watsup:666.1-668.51 - rule load-pack-oob {i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [TRAP_admininstr]) - -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:182.1-183.91 + rule return_call_ref-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) - ;; 8-reduction.watsup:670.1-672.61 - rule load-pack-val {c : c, i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [CONST_admininstr(nt, $ext(n, o0, sx, c))]) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) + ;; 8-reduction.watsup:178.1-180.59 + rule return_call_ref-frame-addr {a : addr, f : frame, instr* : instr*, k : nat, m : m, n : n, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, val'* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - ;; 8-reduction.watsup:692.1-694.44 - rule memory.size {n : n, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) - -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:175.1-176.78 + rule return_call_ref-frame-null {f : frame, ht : heaptype, instr* : instr*, k : nat, val* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), [TRAP_admininstr]) - ;; 8-reduction.watsup:705.1-707.37 - rule memory.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:171.1-172.76 + rule return_call {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) RETURN_CALL_REF_admininstr(?())]) - ;; 8-reduction.watsup:709.1-712.14 - rule memory.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:163.1-168.59 + rule call_ref-func {a : addr, f : frame, fi : funcinst, instr* : instr*, m : m, n : n, t* : valtype*, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, x? : idx?, y : idx, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], $admininstr_instr(instr)*{instr})])]) + -- if ($funcinst(z)[a] = fi) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) + -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) - ;; 8-reduction.watsup:714.1-718.15 - rule memory.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr(x)]) - -- otherwise + ;; 8-reduction.watsup:160.1-161.43 + rule call_ref-null {ht : heaptype, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) - ;; 8-reduction.watsup:721.1-723.77 - rule memory.copy-oob {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) + ;; 8-reduction.watsup:157.1-158.62 + rule call {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) CALL_REF_admininstr(?())]) - ;; 8-reduction.watsup:725.1-728.14 - rule memory.copy-zero {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), []) + ;; 8-reduction.watsup:150.1-152.15 + rule br_on_cast_fail-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) -- otherwise - -- if (n = 0) - ;; 8-reduction.watsup:730.1-735.19 - rule memory.copy-le {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, (i_1 + 1)) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) - -- otherwise - -- if (i_1 <= i_2) + ;; 8-reduction.watsup:145.1-148.66 + rule br_on_cast_fail-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt) + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) - ;; 8-reduction.watsup:737.1-741.15 - rule memory.copy-gt {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) + ;; 8-reduction.watsup:140.1-142.15 + rule br_on_cast-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) -- otherwise - ;; 8-reduction.watsup:744.1-746.70 - rule memory.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) + ;; 8-reduction.watsup:135.1-138.66 + rule br_on_cast-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt) + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) - ;; 8-reduction.watsup:748.1-751.14 - rule memory.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:72.1-74.43 + rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 8-reduction.watsup:753.1-757.15 - rule memory.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, y).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x, y)]) - -- otherwise + ;; 8-reduction.watsup:68.1-70.43 + rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) ;; 8-reduction.watsup:5.1-5.63 relation Step: `%~>%`(config, config) - ;; 8-reduction.watsup:10.1-12.34 - rule pure {instr* : instr*, instr'* : instr*, z : state}: - `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) - -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) + ;; 8-reduction.watsup:760.1-761.51 + rule data.drop {x : idx, z : state}: + `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) - ;; 8-reduction.watsup:14.1-16.37 - rule read {instr* : instr*, instr'* : instr*, z : state}: - `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) - -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) + ;; 8-reduction.watsup:701.1-702.77 + rule memory.grow-fail {n : n, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) - ;; 8-reduction.watsup:317.1-320.61 - rule struct.new {mut^n : mut^n, n : n, si : structinst, val^n : val^n, x : idx, z : state, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) - -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) + ;; 8-reduction.watsup:697.1-699.40 + rule memory.grow-succeed {mi : meminst, n : n, x : idx, z : state, o0 : meminst}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, (|$mem(z, x).DATA_meminst| / (64 * $Ki)))])) + -- if ($growmemory($mem(z, x), n) = ?(o0)) + -- if (mi = o0) - ;; 8-reduction.watsup:337.1-338.53 - rule struct.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`(z, [TRAP_admininstr])) + ;; 8-reduction.watsup:687.1-689.48 + rule store-pack-val {b* : byte*, c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (n / 8), b*{b}), [])) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if (b*{b} = $ibytes(n, $wrap(o0, n, c))) - ;; 8-reduction.watsup:340.1-343.35 - rule struct.set-struct {a : addr, fv : fieldval, i : nat, mut* : mut*, val : val, x : idx, z : state, zt* : storagetype*}: - `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`($with_struct(z, a, i, fv), [])) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + ;; 8-reduction.watsup:683.1-685.51 + rule store-pack-oob {c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:356.1-359.61 - rule array.new_fixed {ai : arrayinst, mut : mut, n : n, val^n : val^n, x : idx, z : state, zt : storagetype}: - `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) + ;; 8-reduction.watsup:679.1-681.29 + rule store-num-val {b* : byte*, c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (o0 / 8), b*{b}), [])) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if (b*{b} = $ntbytes(nt, c)) - ;; 8-reduction.watsup:396.1-397.64 - rule array.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + ;; 8-reduction.watsup:675.1-677.59 + rule store-num-oob {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if (((i + mo.OFFSET_memop) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:399.1-401.38 - rule array.set-oob {a : addr, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) - -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:652.1-653.51 + rule elem.drop {x : idx, z : state}: + `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) - ;; 8-reduction.watsup:403.1-406.31 - rule array.set-array {a : addr, fv : fieldval, i : nat, mut : mut, val : val, x : idx, z : state, zt : storagetype}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) - -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) - -- if (fv = $packval(zt, val)) + ;; 8-reduction.watsup:593.1-594.80 + rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) - ;; 8-reduction.watsup:549.1-550.56 - rule local.set {val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) + ;; 8-reduction.watsup:589.1-591.46 + rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state, o0 : tableinst}: + `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) + -- if ($growtable($table(z, x), n, ref) = ?(o0)) + -- if (ti = o0) - ;; 8-reduction.watsup:561.1-562.58 - rule global.set {val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) + ;; 8-reduction.watsup:579.1-581.32 + rule table.set-val {i : nat, ref : ref, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) + -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup:575.1-577.33 rule table.set-oob {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:579.1-581.32 - rule table.set-val {i : nat, ref : ref, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) - -- if (i < |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:561.1-562.58 + rule global.set {val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) - ;; 8-reduction.watsup:589.1-591.46 - rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state, o0 : tableinst}: - `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) - -- if ($growtable($table(z, x), n, ref) = ?(o0)) - -- if (ti = o0) + ;; 8-reduction.watsup:549.1-550.56 + rule local.set {val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) - ;; 8-reduction.watsup:593.1-594.80 - rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) + ;; 8-reduction.watsup:403.1-406.31 + rule array.set-array {a : addr, fv : fieldval, i : nat, mut : mut, val : val, x : idx, z : state, zt : storagetype}: + `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) + -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) + -- if (fv = $packval(zt, val)) - ;; 8-reduction.watsup:652.1-653.51 - rule elem.drop {x : idx, z : state}: - `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) + ;; 8-reduction.watsup:399.1-401.38 + rule array.set-oob {a : addr, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:675.1-677.59 - rule store-num-oob {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if (((i + mo.OFFSET_memop) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:396.1-397.64 + rule array.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) - ;; 8-reduction.watsup:679.1-681.29 - rule store-num-val {b* : byte*, c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (o0 / 8), b*{b}), [])) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if (b*{b} = $ntbytes(nt, c)) + ;; 8-reduction.watsup:356.1-359.61 + rule array.new_fixed {ai : arrayinst, mut : mut, n : n, val^n : val^n, x : idx, z : state, zt : storagetype}: + `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) - ;; 8-reduction.watsup:683.1-685.51 - rule store-pack-oob {c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:340.1-343.35 + rule struct.set-struct {a : addr, fv : fieldval, i : nat, mut* : mut*, val : val, x : idx, z : state, zt* : storagetype*}: + `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`($with_struct(z, a, i, fv), [])) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- if (fv = $packval(zt*{zt}[i], val)) - ;; 8-reduction.watsup:687.1-689.48 - rule store-pack-val {b* : byte*, c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (n / 8), b*{b}), [])) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if (b*{b} = $ibytes(n, $wrap(o0, n, c))) + ;; 8-reduction.watsup:337.1-338.53 + rule struct.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`(z, [TRAP_admininstr])) - ;; 8-reduction.watsup:697.1-699.40 - rule memory.grow-succeed {mi : meminst, n : n, x : idx, z : state, o0 : meminst}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, (|$mem(z, x).DATA_meminst| / (64 * $Ki)))])) - -- if ($growmemory($mem(z, x), n) = ?(o0)) - -- if (mi = o0) + ;; 8-reduction.watsup:317.1-320.61 + rule struct.new {mut^n : mut^n, n : n, si : structinst, val^n : val^n, x : idx, z : state, zt^n : storagetype^n}: + `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) + -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) - ;; 8-reduction.watsup:701.1-702.77 - rule memory.grow-fail {n : n, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) + ;; 8-reduction.watsup:14.1-16.37 + rule read {instr* : instr*, instr'* : instr*, z : state}: + `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) + -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) - ;; 8-reduction.watsup:760.1-761.51 - rule data.drop {x : idx, z : state}: - `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) + ;; 8-reduction.watsup:10.1-12.34 + rule pure {instr* : instr*, instr'* : instr*, z : state}: + `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) + -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) ;; 8-reduction.watsup:8.1-8.63 rec { ;; 8-reduction.watsup:8.1-8.63 relation Steps: `%~>*%`(config, config) - ;; 8-reduction.watsup:18.1-19.36 - rule refl {admininstr* : admininstr*, z : state}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) - ;; 8-reduction.watsup:21.1-24.53 rule trans {admininstr* : admininstr*, admininstr' : admininstr, admininstr''* : admininstr*, z : state, z' : state, z'' : state}: `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z'', admininstr''*{admininstr''})) -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z', admininstr'*{})) -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr''})) + + ;; 8-reduction.watsup:18.1-19.36 + rule refl {admininstr* : admininstr*, z : state}: + `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) } ;; 8-reduction.watsup:29.1-29.69 @@ -20401,14 +20544,14 @@ rec { ;; 9-module.watsup:7.1-7.34 def alloctypes : type* -> deftype* - ;; 9-module.watsup:8.1-8.27 - def alloctypes([]) = [] ;; 9-module.watsup:9.1-13.24 def {deftype* : deftype*, deftype'* : deftype*, rectype : rectype, type : type, type'* : type*, x : idx} alloctypes(type'*{type'} :: [type]) = deftype'*{deftype'} :: deftype*{deftype} -- if (deftype'*{deftype'} = $alloctypes(type'*{type'})) -- if (type = TYPE(rectype)) -- if (deftype*{deftype} = $subst_all_deftypes($rolldt(x, rectype), $heaptype_deftype(deftype')*{deftype'})) -- if (x = |deftype'*{deftype'}|) + ;; 9-module.watsup:8.1-8.27 + def alloctypes([]) = [] } ;; 9-module.watsup:15.1-15.60 @@ -20423,12 +20566,12 @@ rec { ;; 9-module.watsup:20.1-20.63 def allocfuncs : (store, moduleinst, func*) -> (store, funcaddr*) - ;; 9-module.watsup:21.1-21.39 - def {mm : moduleinst, s : store} allocfuncs(s, mm, []) = (s, []) ;; 9-module.watsup:22.1-24.51 def {fa : funcaddr, fa'* : funcaddr*, func : func, func'* : func*, mm : moduleinst, s : store, s_1 : store, s_2 : store} allocfuncs(s, mm, [func] :: func'*{func'}) = (s_2, [fa] :: fa'*{fa'}) -- if ((s_1, fa) = $allocfunc(s, mm, func)) -- if ((s_2, fa'*{fa'}) = $allocfuncs(s_1, mm, func'*{func'})) + ;; 9-module.watsup:21.1-21.39 + def {mm : moduleinst, s : store} allocfuncs(s, mm, []) = (s, []) } ;; 9-module.watsup:26.1-26.63 @@ -20442,12 +20585,12 @@ rec { ;; 9-module.watsup:30.1-30.67 def allocglobals : (store, globaltype*, val*) -> (store, globaladdr*) - ;; 9-module.watsup:31.1-31.42 - def {s : store} allocglobals(s, [], []) = (s, []) ;; 9-module.watsup:32.1-34.62 def {ga : globaladdr, ga'* : globaladdr*, globaltype : globaltype, globaltype'* : globaltype*, s : store, s_1 : store, s_2 : store, val : val, val'* : val*} allocglobals(s, [globaltype] :: globaltype'*{globaltype'}, [val] :: val'*{val'}) = (s_2, [ga] :: ga'*{ga'}) -- if ((s_1, ga) = $allocglobal(s, globaltype, val)) -- if ((s_2, ga'*{ga'}) = $allocglobals(s_1, globaltype'*{globaltype'}, val'*{val'})) + ;; 9-module.watsup:31.1-31.42 + def {s : store} allocglobals(s, [], []) = (s, []) } ;; 9-module.watsup:36.1-36.60 @@ -20461,12 +20604,12 @@ rec { ;; 9-module.watsup:40.1-40.64 def alloctables : (store, tabletype*, ref*) -> (store, tableaddr*) - ;; 9-module.watsup:41.1-41.41 - def {s : store} alloctables(s, [], []) = (s, []) ;; 9-module.watsup:42.1-44.60 def {ref : ref, ref'* : ref*, s : store, s_1 : store, s_2 : store, ta : tableaddr, ta'* : tableaddr*, tabletype : tabletype, tabletype'* : tabletype*} alloctables(s, [tabletype] :: tabletype'*{tabletype'}, [ref] :: ref'*{ref'}) = (s_2, [ta] :: ta'*{ta'}) -- if ((s_1, ta) = $alloctable(s, tabletype, ref)) -- if ((s_2, ta'*{ta'}) = $alloctables(s_1, tabletype'*{tabletype'}, ref'*{ref'})) + ;; 9-module.watsup:41.1-41.41 + def {s : store} alloctables(s, [], []) = (s, []) } ;; 9-module.watsup:46.1-46.49 @@ -20480,12 +20623,12 @@ rec { ;; 9-module.watsup:50.1-50.52 def allocmems : (store, memtype*) -> (store, memaddr*) - ;; 9-module.watsup:51.1-51.34 - def {s : store} allocmems(s, []) = (s, []) ;; 9-module.watsup:52.1-54.49 def {ma : memaddr, ma'* : memaddr*, memtype : memtype, memtype'* : memtype*, s : store, s_1 : store, s_2 : store} allocmems(s, [memtype] :: memtype'*{memtype'}) = (s_2, [ma] :: ma'*{ma'}) -- if ((s_1, ma) = $allocmem(s, memtype)) -- if ((s_2, ma'*{ma'}) = $allocmems(s_1, memtype'*{memtype'})) + ;; 9-module.watsup:51.1-51.34 + def {s : store} allocmems(s, []) = (s, []) } ;; 9-module.watsup:56.1-56.57 @@ -20499,12 +20642,12 @@ rec { ;; 9-module.watsup:60.1-60.63 def allocelems : (store, reftype*, ref**) -> (store, elemaddr*) - ;; 9-module.watsup:61.1-61.40 - def {s : store} allocelems(s, [], []) = (s, []) ;; 9-module.watsup:62.1-64.55 def {ea : elemaddr, ea'* : elemaddr*, ref* : ref*, ref'** : ref**, rt : reftype, rt'* : reftype*, s : store, s_1 : store, s_2 : store} allocelems(s, [rt] :: rt'*{rt'}, [ref*{ref}] :: ref'*{ref'}*{ref'}) = (s_2, [ea] :: ea'*{ea'}) -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref})) -- if ((s_2, ea'*{ea'}) = $allocelems(s_2, rt'*{rt'}, ref'*{ref'}*{ref'})) + ;; 9-module.watsup:61.1-61.40 + def {s : store} allocelems(s, [], []) = (s, []) } ;; 9-module.watsup:66.1-66.49 @@ -20518,24 +20661,24 @@ rec { ;; 9-module.watsup:70.1-70.54 def allocdatas : (store, byte**) -> (store, dataaddr*) - ;; 9-module.watsup:71.1-71.35 - def {s : store} allocdatas(s, []) = (s, []) ;; 9-module.watsup:72.1-74.50 def {byte* : byte*, byte'** : byte**, da : dataaddr, da'* : dataaddr*, s : store, s_1 : store, s_2 : store} allocdatas(s, [byte*{byte}] :: byte'*{byte'}*{byte'}) = (s_2, [da] :: da'*{da'}) -- if ((s_1, da) = $allocdata(s, byte*{byte})) -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) + ;; 9-module.watsup:71.1-71.35 + def {s : store} allocdatas(s, []) = (s, []) } ;; 9-module.watsup:79.1-79.83 def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst - ;; 9-module.watsup:80.1-80.95 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} - ;; 9-module.watsup:81.1-81.99 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} - ;; 9-module.watsup:82.1-82.97 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} ;; 9-module.watsup:83.1-83.93 def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} + ;; 9-module.watsup:82.1-82.97 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} + ;; 9-module.watsup:81.1-81.99 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} + ;; 9-module.watsup:80.1-80.95 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} ;; 9-module.watsup:86.1-86.87 def allocmodule : (store, module, externval*, val*, ref*, ref**) -> (store, moduleinst) @@ -20567,27 +20710,27 @@ rec { ;; 9-module.watsup:134.1-134.38 def concat_instr : instr** -> instr* - ;; 9-module.watsup:135.1-135.29 - def concat_instr([]) = [] ;; 9-module.watsup:136.1-136.74 def {instr* : instr*, instr'** : instr**} concat_instr([instr*{instr}] :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) + ;; 9-module.watsup:135.1-135.29 + def concat_instr([]) = [] } ;; 9-module.watsup:138.1-138.33 def runelem : (elem, idx) -> instr* - ;; 9-module.watsup:139.1-139.52 - def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, PASSIVE_elemmode), y) = [] - ;; 9-module.watsup:140.1-140.62 - def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] ;; 9-module.watsup:141.1-142.77 def {expr* : expr*, instr* : instr*, reftype : reftype, x : idx, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, ACTIVE_elemmode(x, instr*{instr})), y) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, |expr*{expr}|) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] + ;; 9-module.watsup:140.1-140.62 + def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] + ;; 9-module.watsup:139.1-139.52 + def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, PASSIVE_elemmode), y) = [] ;; 9-module.watsup:144.1-144.33 def rundata : (data, idx) -> instr* - ;; 9-module.watsup:145.1-145.44 - def {byte* : byte*, y : idx} rundata(`DATA%*%`(byte*{byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup:146.1-147.78 def {byte* : byte*, instr* : instr*, x : idx, y : idx} rundata(`DATA%*%`(byte*{byte}, ACTIVE_datamode(x, instr*{instr})), y) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, |byte*{byte}|) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] + ;; 9-module.watsup:145.1-145.44 + def {byte* : byte*, y : idx} rundata(`DATA%*%`(byte*{byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup:149.1-149.53 def instantiate : (store, module, externval*) -> config @@ -20624,20 +20767,20 @@ rec { ;; A-binary.watsup:47.1-47.24 def utf8 : name -> byte* - ;; A-binary.watsup:48.1-48.44 - def {b : byte, c : c} utf8([c]) = [b] - -- if ((c < 128) /\ (c = b)) - ;; A-binary.watsup:49.1-49.93 - def {b_1 : byte, b_2 : byte, c : c} utf8([c]) = [b_1 b_2] - -- if (((128 <= c) /\ (c < 2048)) /\ (c = (((2 ^ 6) * (b_1 - 192)) + (b_2 - 128)))) - ;; A-binary.watsup:50.1-50.144 - def {b_1 : byte, b_2 : byte, b_3 : byte, c : c} utf8([c]) = [b_1 b_2 b_3] - -- if ((((2048 <= c) /\ (c < 55296)) \/ ((57344 <= c) /\ (c < 65536))) /\ (c = ((((2 ^ 12) * (b_1 - 224)) + ((2 ^ 6) * (b_2 - 128))) + (b_3 - 128)))) + ;; A-binary.watsup:52.1-52.41 + def {c* : c*} utf8(c*{c}) = $concat_bytes($utf8([c])*{c}) ;; A-binary.watsup:51.1-51.145 def {b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte, c : c} utf8([c]) = [b_1 b_2 b_3 b_4] -- if (((65536 <= c) /\ (c < 69632)) /\ (c = (((((2 ^ 18) * (b_1 - 240)) + ((2 ^ 12) * (b_2 - 128))) + ((2 ^ 6) * (b_3 - 128))) + (b_4 - 128)))) - ;; A-binary.watsup:52.1-52.41 - def {c* : c*} utf8(c*{c}) = $concat_bytes($utf8([c])*{c}) + ;; A-binary.watsup:50.1-50.144 + def {b_1 : byte, b_2 : byte, b_3 : byte, c : c} utf8([c]) = [b_1 b_2 b_3] + -- if ((((2048 <= c) /\ (c < 55296)) \/ ((57344 <= c) /\ (c < 65536))) /\ (c = ((((2 ^ 12) * (b_1 - 224)) + ((2 ^ 6) * (b_2 - 128))) + (b_3 - 128)))) + ;; A-binary.watsup:49.1-49.93 + def {b_1 : byte, b_2 : byte, c : c} utf8([c]) = [b_1 b_2] + -- if (((128 <= c) /\ (c < 2048)) /\ (c = (((2 ^ 6) * (b_1 - 192)) + (b_2 - 128)))) + ;; A-binary.watsup:48.1-48.44 + def {b : byte, c : c} utf8([c]) = [b] + -- if ((c < 128) /\ (c = b)) } ;; A-binary.watsup:210.1-210.27 @@ -20651,10 +20794,10 @@ rec { ;; A-binary.watsup:665.1-665.62 def concat_locals : local** -> local* - ;; A-binary.watsup:666.1-666.30 - def concat_locals([]) = [] ;; A-binary.watsup:667.1-667.68 def {loc* : local*, loc'** : local**} concat_locals([loc*{loc}] :: loc'*{loc'}*{loc'}) = loc*{loc} :: $concat_locals(loc'*{loc'}*{loc'}) + ;; A-binary.watsup:666.1-666.30 + def concat_locals([]) = [] } ;; A-binary.watsup:670.1-670.29 @@ -20685,12 +20828,12 @@ rec { ;; 0-aux.watsup:27.1-27.25 def min : (nat, nat) -> nat - ;; 0-aux.watsup:28.1-28.19 - def {j : nat} min(0, j) = 0 - ;; 0-aux.watsup:29.1-29.19 - def {i : nat} min(i, 0) = 0 ;; 0-aux.watsup:30.1-30.38 def {i : nat, j : nat} min((i + 1), (j + 1)) = $min(i, j) + ;; 0-aux.watsup:29.1-29.19 + def {i : nat} min(i, 0) = 0 + ;; 0-aux.watsup:28.1-28.19 + def {j : nat} min(0, j) = 0 } ;; 0-aux.watsup:32.1-32.21 @@ -20698,10 +20841,10 @@ rec { ;; 0-aux.watsup:32.1-32.21 def sum : nat* -> nat - ;; 0-aux.watsup:33.1-33.18 - def sum([]) = 0 ;; 0-aux.watsup:34.1-34.35 def {n : n, n'* : n*} sum([n] :: n'*{n'}) = (n + $sum(n'*{n'})) + ;; 0-aux.watsup:33.1-33.18 + def sum([]) = 0 } ;; 1-syntax.watsup:5.1-5.85 @@ -20739,17 +20882,17 @@ syntax s33 = sN ;; 1-syntax.watsup:35.1-35.21 def signif : N -> nat - ;; 1-syntax.watsup:36.1-36.21 - def signif(32) = 23 ;; 1-syntax.watsup:37.1-37.21 def signif(64) = 52 + ;; 1-syntax.watsup:36.1-36.21 + def signif(32) = 23 ;; 1-syntax.watsup:39.1-39.20 def expon : N -> nat - ;; 1-syntax.watsup:40.1-40.19 - def expon(32) = 8 ;; 1-syntax.watsup:41.1-41.20 def expon(64) = 11 + ;; 1-syntax.watsup:40.1-40.19 + def expon(32) = 8 ;; 1-syntax.watsup:43.1-43.35 def M : N -> nat @@ -21295,14 +21438,14 @@ rec { ;; 2-syntax-aux.watsup:8.1-8.33 def setminus1 : (idx, idx*) -> idx* - ;; 2-syntax-aux.watsup:13.1-13.27 - def {x : idx} setminus1(x, []) = [x] - ;; 2-syntax-aux.watsup:14.1-14.57 - def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = [] - -- if (x = y_1) ;; 2-syntax-aux.watsup:15.1-15.60 def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = $setminus1(x, y*{y}) -- otherwise + ;; 2-syntax-aux.watsup:14.1-14.57 + def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = [] + -- if (x = y_1) + ;; 2-syntax-aux.watsup:13.1-13.27 + def {x : idx} setminus1(x, []) = [x] } ;; 2-syntax-aux.watsup:7.1-7.49 @@ -21310,30 +21453,30 @@ rec { ;; 2-syntax-aux.watsup:7.1-7.49 def setminus : (idx*, idx*) -> idx* - ;; 2-syntax-aux.watsup:10.1-10.29 - def {y* : idx*} setminus([], y*{y}) = [] ;; 2-syntax-aux.watsup:11.1-11.66 def {x* : idx*, x_1 : idx, y* : idx*} setminus([x_1] :: x*{x}, y*{y}) = $setminus1(x_1, y*{y}) :: $setminus(x*{x}, y*{y}) + ;; 2-syntax-aux.watsup:10.1-10.29 + def {y* : idx*} setminus([], y*{y}) = [] } ;; 2-syntax-aux.watsup:20.1-20.68 def free_dataidx_instr : instr -> dataidx* - ;; 2-syntax-aux.watsup:21.1-21.45 - def {x : idx, y : idx} free_dataidx_instr(MEMORY.INIT_instr(x, y)) = [y] - ;; 2-syntax-aux.watsup:22.1-22.41 - def {x : idx} free_dataidx_instr(DATA.DROP_instr(x)) = [x] ;; 2-syntax-aux.watsup:23.1-23.34 def {in : instr} free_dataidx_instr(in) = [] + ;; 2-syntax-aux.watsup:22.1-22.41 + def {x : idx} free_dataidx_instr(DATA.DROP_instr(x)) = [x] + ;; 2-syntax-aux.watsup:21.1-21.45 + def {x : idx, y : idx} free_dataidx_instr(MEMORY.INIT_instr(x, y)) = [y] ;; 2-syntax-aux.watsup:25.1-25.70 rec { ;; 2-syntax-aux.watsup:25.1-25.70 def free_dataidx_instrs : instr* -> dataidx* - ;; 2-syntax-aux.watsup:26.1-26.36 - def free_dataidx_instrs([]) = [] ;; 2-syntax-aux.watsup:27.1-27.99 def {instr : instr, instr'* : instr*} free_dataidx_instrs([instr] :: instr'*{instr'}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr'}) + ;; 2-syntax-aux.watsup:26.1-26.36 + def free_dataidx_instrs([]) = [] } ;; 2-syntax-aux.watsup:29.1-29.66 @@ -21351,10 +21494,10 @@ rec { ;; 2-syntax-aux.watsup:35.1-35.68 def free_dataidx_funcs : func* -> dataidx* - ;; 2-syntax-aux.watsup:36.1-36.35 - def free_dataidx_funcs([]) = [] ;; 2-syntax-aux.watsup:37.1-37.92 def {func : func, func'* : func*} free_dataidx_funcs([func] :: func'*{func'}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func'}) + ;; 2-syntax-aux.watsup:36.1-36.35 + def free_dataidx_funcs([]) = [] } ;; 2-syntax-aux.watsup:46.1-46.59 @@ -21362,67 +21505,67 @@ rec { ;; 2-syntax-aux.watsup:46.1-46.59 def concat_bytes : byte** -> byte* - ;; 2-syntax-aux.watsup:47.1-47.29 - def concat_bytes([]) = [] ;; 2-syntax-aux.watsup:48.1-48.58 def {b* : byte*, b'** : byte**} concat_bytes([b*{b}] :: b'*{b'}*{b'}) = b*{b} :: $concat_bytes(b'*{b'}*{b'}) + ;; 2-syntax-aux.watsup:47.1-47.29 + def concat_bytes([]) = [] } ;; 2-syntax-aux.watsup:59.1-59.55 def size : valtype -> nat? - ;; 2-syntax-aux.watsup:60.1-60.20 - def size(I32_valtype) = ?(32) - ;; 2-syntax-aux.watsup:61.1-61.20 - def size(I64_valtype) = ?(64) - ;; 2-syntax-aux.watsup:62.1-62.20 - def size(F32_valtype) = ?(32) - ;; 2-syntax-aux.watsup:63.1-63.20 - def size(F64_valtype) = ?(64) ;; 2-syntax-aux.watsup:64.1-64.22 def size(V128_valtype) = ?(128) + ;; 2-syntax-aux.watsup:63.1-63.20 + def size(F64_valtype) = ?(64) + ;; 2-syntax-aux.watsup:62.1-62.20 + def size(F32_valtype) = ?(32) + ;; 2-syntax-aux.watsup:61.1-61.20 + def size(I64_valtype) = ?(64) + ;; 2-syntax-aux.watsup:60.1-60.20 + def size(I32_valtype) = ?(32) def {x : valtype} size(x) = ?() ;; 2-syntax-aux.watsup:66.1-66.50 def packedsize : packedtype -> nat - ;; 2-syntax-aux.watsup:67.1-67.24 - def packedsize(I8_packedtype) = 8 ;; 2-syntax-aux.watsup:68.1-68.26 def packedsize(I16_packedtype) = 16 + ;; 2-syntax-aux.watsup:67.1-67.24 + def packedsize(I8_packedtype) = 8 ;; 2-syntax-aux.watsup:70.1-70.52 def storagesize : storagetype -> nat - ;; 2-syntax-aux.watsup:71.1-71.43 - def {valtype : valtype} storagesize($storagetype_valtype(valtype)) = !($size(valtype)) ;; 2-syntax-aux.watsup:72.1-72.55 def {packedtype : packedtype} storagesize($storagetype_packedtype(packedtype)) = $packedsize(packedtype) + ;; 2-syntax-aux.watsup:71.1-71.43 + def {valtype : valtype} storagesize($storagetype_valtype(valtype)) = !($size(valtype)) ;; 2-syntax-aux.watsup:77.1-77.62 def unpacktype : storagetype -> valtype - ;; 2-syntax-aux.watsup:78.1-78.35 - def {valtype : valtype} unpacktype($storagetype_valtype(valtype)) = valtype ;; 2-syntax-aux.watsup:79.1-79.34 def {packedtype : packedtype} unpacktype($storagetype_packedtype(packedtype)) = I32_valtype + ;; 2-syntax-aux.watsup:78.1-78.35 + def {valtype : valtype} unpacktype($storagetype_valtype(valtype)) = valtype ;; 2-syntax-aux.watsup:81.1-81.65 def unpacknumtype : storagetype -> numtype - ;; 2-syntax-aux.watsup:82.1-82.38 - def {numtype : numtype} unpacknumtype($storagetype_numtype(numtype)) = numtype ;; 2-syntax-aux.watsup:83.1-83.37 def {packedtype : packedtype} unpacknumtype($storagetype_packedtype(packedtype)) = I32_numtype + ;; 2-syntax-aux.watsup:82.1-82.38 + def {numtype : numtype} unpacknumtype($storagetype_numtype(numtype)) = numtype ;; 2-syntax-aux.watsup:85.1-85.51 def sxfield : storagetype -> sx? - ;; 2-syntax-aux.watsup:86.1-86.28 - def {valtype : valtype} sxfield($storagetype_valtype(valtype)) = ?() ;; 2-syntax-aux.watsup:87.1-87.29 def {packedtype : packedtype} sxfield($storagetype_packedtype(packedtype)) = ?(S_sx) + ;; 2-syntax-aux.watsup:86.1-86.28 + def {valtype : valtype} sxfield($storagetype_valtype(valtype)) = ?() ;; 2-syntax-aux.watsup:92.1-92.59 def diffrt : (reftype, reftype) -> reftype - ;; 2-syntax-aux.watsup:94.1-94.64 - def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) = REF_reftype(`NULL%?`(?()), ht_1) ;; 2-syntax-aux.watsup:95.1-95.65 def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?()), ht_2)) = REF_reftype(nul_1, ht_1) + ;; 2-syntax-aux.watsup:94.1-94.64 + def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) = REF_reftype(`NULL%?`(?()), ht_1) ;; 2-syntax-aux.watsup:100.1-100.42 syntax typevar = @@ -21443,14 +21586,14 @@ rec { ;; 2-syntax-aux.watsup:109.1-109.92 def subst_typevar : (typevar, typevar*, heaptype*) -> heaptype - ;; 2-syntax-aux.watsup:134.1-134.38 - def {xx : typevar} subst_typevar(xx, [], []) = $heaptype_typevar(xx) - ;; 2-syntax-aux.watsup:135.1-135.95 - def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 - -- if (xx = xx_1) ;; 2-syntax-aux.watsup:136.1-136.92 def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = $subst_typevar(xx, xx'*{xx'}, ht'*{ht'}) -- otherwise + ;; 2-syntax-aux.watsup:135.1-135.95 + def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 + -- if (xx = xx_1) + ;; 2-syntax-aux.watsup:134.1-134.38 + def {xx : typevar} subst_typevar(xx, [], []) = $heaptype_typevar(xx) } ;; 2-syntax-aux.watsup:111.1-111.92 @@ -21473,13 +21616,13 @@ rec { ;; 2-syntax-aux.watsup:113.1-113.92 def subst_heaptype : (heaptype, typevar*, heaptype*) -> heaptype - ;; 2-syntax-aux.watsup:141.1-141.67 - def {ht* : heaptype*, xx* : typevar*, xx' : typevar} subst_heaptype($heaptype_typevar(xx'), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) - ;; 2-syntax-aux.watsup:142.1-142.65 - def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_heaptype($heaptype_deftype(dt), xx*{xx}, ht*{ht}) = $heaptype_deftype($subst_deftype(dt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:143.1-143.55 def {ht* : heaptype*, ht' : heaptype, xx* : typevar*} subst_heaptype(ht', xx*{xx}, ht*{ht}) = ht' -- otherwise + ;; 2-syntax-aux.watsup:142.1-142.65 + def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_heaptype($heaptype_deftype(dt), xx*{xx}, ht*{ht}) = $heaptype_deftype($subst_deftype(dt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:141.1-141.67 + def {ht* : heaptype*, xx* : typevar*, xx' : typevar} subst_heaptype($heaptype_typevar(xx'), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) ;; 2-syntax-aux.watsup:114.1-114.92 def subst_reftype : (reftype, typevar*, heaptype*) -> reftype @@ -21488,21 +21631,21 @@ def subst_reftype : (reftype, typevar*, heaptype*) -> reftype ;; 2-syntax-aux.watsup:115.1-115.92 def subst_valtype : (valtype, typevar*, heaptype*) -> valtype - ;; 2-syntax-aux.watsup:147.1-147.64 - def {ht* : heaptype*, nt : numtype, xx* : typevar*} subst_valtype($valtype_numtype(nt), xx*{xx}, ht*{ht}) = $valtype_numtype($subst_numtype(nt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:148.1-148.64 - def {ht* : heaptype*, vt : vectype, xx* : typevar*} subst_valtype($valtype_vectype(vt), xx*{xx}, ht*{ht}) = $valtype_vectype($subst_vectype(vt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:149.1-149.64 - def {ht* : heaptype*, rt : reftype, xx* : typevar*} subst_valtype($valtype_reftype(rt), xx*{xx}, ht*{ht}) = $valtype_reftype($subst_reftype(rt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:150.1-150.40 def {ht* : heaptype*, xx* : typevar*} subst_valtype(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + ;; 2-syntax-aux.watsup:149.1-149.64 + def {ht* : heaptype*, rt : reftype, xx* : typevar*} subst_valtype($valtype_reftype(rt), xx*{xx}, ht*{ht}) = $valtype_reftype($subst_reftype(rt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:148.1-148.64 + def {ht* : heaptype*, vt : vectype, xx* : typevar*} subst_valtype($valtype_vectype(vt), xx*{xx}, ht*{ht}) = $valtype_vectype($subst_vectype(vt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:147.1-147.64 + def {ht* : heaptype*, nt : numtype, xx* : typevar*} subst_valtype($valtype_numtype(nt), xx*{xx}, ht*{ht}) = $valtype_numtype($subst_numtype(nt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:118.1-118.92 def subst_storagetype : (storagetype, typevar*, heaptype*) -> storagetype - ;; 2-syntax-aux.watsup:154.1-154.66 - def {ht* : heaptype*, t : valtype, xx* : typevar*} subst_storagetype($storagetype_valtype(t), xx*{xx}, ht*{ht}) = $storagetype_valtype($subst_valtype(t, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:155.1-155.71 def {ht* : heaptype*, pt : packedtype, xx* : typevar*} subst_storagetype($storagetype_packedtype(pt), xx*{xx}, ht*{ht}) = $storagetype_packedtype($subst_packedtype(pt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:154.1-154.66 + def {ht* : heaptype*, t : valtype, xx* : typevar*} subst_storagetype($storagetype_valtype(t), xx*{xx}, ht*{ht}) = $storagetype_valtype($subst_valtype(t, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:119.1-119.92 def subst_fieldtype : (fieldtype, typevar*, heaptype*) -> fieldtype @@ -21511,19 +21654,19 @@ def subst_fieldtype : (fieldtype, typevar*, heaptype*) -> fieldtype ;; 2-syntax-aux.watsup:121.1-121.92 def subst_comptype : (comptype, typevar*, heaptype*) -> comptype - ;; 2-syntax-aux.watsup:159.1-159.85 - def {ht* : heaptype*, xx* : typevar*, yt* : fieldtype*} subst_comptype(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) - ;; 2-syntax-aux.watsup:160.1-160.81 - def {ht* : heaptype*, xx* : typevar*, yt : fieldtype} subst_comptype(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:161.1-161.78 def {ft : functype, ht* : heaptype*, xx* : typevar*} subst_comptype(FUNC_comptype(ft), xx*{xx}, ht*{ht}) = FUNC_comptype($subst_functype(ft, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:160.1-160.81 + def {ht* : heaptype*, xx* : typevar*, yt : fieldtype} subst_comptype(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:159.1-159.85 + def {ht* : heaptype*, xx* : typevar*, yt* : fieldtype*} subst_comptype(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) ;; 2-syntax-aux.watsup:122.1-122.92 def subst_subtype : (subtype, typevar*, heaptype*) -> subtype - ;; 2-syntax-aux.watsup:163.1-164.76 - def {ct : comptype, fin : fin, ht* : heaptype*, xx* : typevar*, y* : idx*} subst_subtype(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:165.1-166.73 def {ct : comptype, fin : fin, ht* : heaptype*, ht'* : heaptype*, xx* : typevar*} subst_subtype(SUBD_subtype(fin, ht'*{ht'}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx}, ht*{ht})*{ht'}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:163.1-164.76 + def {ct : comptype, fin : fin, ht* : heaptype*, xx* : typevar*, y* : idx*} subst_subtype(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:123.1-123.92 def subst_rectype : (rectype, typevar*, heaptype*) -> rectype @@ -21558,14 +21701,14 @@ def subst_memtype : (memtype, typevar*, heaptype*) -> memtype ;; 2-syntax-aux.watsup:131.1-131.92 def subst_externtype : (externtype, typevar*, heaptype*) -> externtype - ;; 2-syntax-aux.watsup:177.1-177.79 - def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_externtype(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:178.1-178.86 - def {gt : globaltype, ht* : heaptype*, xx* : typevar*} subst_externtype(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:179.1-179.83 - def {ht* : heaptype*, tt : tabletype, xx* : typevar*} subst_externtype(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:180.1-180.77 def {ht* : heaptype*, mt : memtype, xx* : typevar*} subst_externtype(MEM_externtype(mt), xx*{xx}, ht*{ht}) = MEM_externtype($subst_memtype(mt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:179.1-179.83 + def {ht* : heaptype*, tt : tabletype, xx* : typevar*} subst_externtype(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:178.1-178.86 + def {gt : globaltype, ht* : heaptype*, xx* : typevar*} subst_externtype(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:177.1-177.79 + def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_externtype(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:183.1-183.74 def subst_all_reftype : (reftype, heaptype*) -> reftype @@ -21582,10 +21725,10 @@ rec { ;; 2-syntax-aux.watsup:189.1-189.77 def subst_all_deftypes : (deftype*, heaptype*) -> deftype* - ;; 2-syntax-aux.watsup:191.1-191.40 - def {ht* : heaptype*} subst_all_deftypes([], ht*{ht}) = [] ;; 2-syntax-aux.watsup:192.1-192.101 def {dt* : deftype*, dt_1 : deftype, ht* : heaptype*} subst_all_deftypes([dt_1] :: dt*{dt}, ht*{ht}) = [$subst_all_deftype(dt_1, ht*{ht})] :: $subst_all_deftypes(dt*{dt}, ht*{ht}) + ;; 2-syntax-aux.watsup:191.1-191.40 + def {ht* : heaptype*} subst_all_deftypes([], ht*{ht}) = [] } ;; 2-syntax-aux.watsup:197.1-197.65 @@ -21629,13 +21772,13 @@ rec { ;; 2-syntax-aux.watsup:221.1-221.64 def funcsxt : externtype* -> deftype* - ;; 2-syntax-aux.watsup:226.1-226.24 - def funcsxt([]) = [] - ;; 2-syntax-aux.watsup:227.1-227.47 - def {dt : deftype, et* : externtype*} funcsxt([FUNC_externtype(dt)] :: et*{et}) = [dt] :: $funcsxt(et*{et}) ;; 2-syntax-aux.watsup:228.1-228.59 def {et* : externtype*, externtype : externtype} funcsxt([externtype] :: et*{et}) = $funcsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:227.1-227.47 + def {dt : deftype, et* : externtype*} funcsxt([FUNC_externtype(dt)] :: et*{et}) = [dt] :: $funcsxt(et*{et}) + ;; 2-syntax-aux.watsup:226.1-226.24 + def funcsxt([]) = [] } ;; 2-syntax-aux.watsup:222.1-222.66 @@ -21643,13 +21786,13 @@ rec { ;; 2-syntax-aux.watsup:222.1-222.66 def globalsxt : externtype* -> globaltype* - ;; 2-syntax-aux.watsup:230.1-230.26 - def globalsxt([]) = [] - ;; 2-syntax-aux.watsup:231.1-231.53 - def {et* : externtype*, gt : globaltype} globalsxt([GLOBAL_externtype(gt)] :: et*{et}) = [gt] :: $globalsxt(et*{et}) ;; 2-syntax-aux.watsup:232.1-232.63 def {et* : externtype*, externtype : externtype} globalsxt([externtype] :: et*{et}) = $globalsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:231.1-231.53 + def {et* : externtype*, gt : globaltype} globalsxt([GLOBAL_externtype(gt)] :: et*{et}) = [gt] :: $globalsxt(et*{et}) + ;; 2-syntax-aux.watsup:230.1-230.26 + def globalsxt([]) = [] } ;; 2-syntax-aux.watsup:223.1-223.65 @@ -21657,13 +21800,13 @@ rec { ;; 2-syntax-aux.watsup:223.1-223.65 def tablesxt : externtype* -> tabletype* - ;; 2-syntax-aux.watsup:234.1-234.25 - def tablesxt([]) = [] - ;; 2-syntax-aux.watsup:235.1-235.50 - def {et* : externtype*, tt : tabletype} tablesxt([TABLE_externtype(tt)] :: et*{et}) = [tt] :: $tablesxt(et*{et}) ;; 2-syntax-aux.watsup:236.1-236.61 def {et* : externtype*, externtype : externtype} tablesxt([externtype] :: et*{et}) = $tablesxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:235.1-235.50 + def {et* : externtype*, tt : tabletype} tablesxt([TABLE_externtype(tt)] :: et*{et}) = [tt] :: $tablesxt(et*{et}) + ;; 2-syntax-aux.watsup:234.1-234.25 + def tablesxt([]) = [] } ;; 2-syntax-aux.watsup:224.1-224.63 @@ -21671,13 +21814,13 @@ rec { ;; 2-syntax-aux.watsup:224.1-224.63 def memsxt : externtype* -> memtype* - ;; 2-syntax-aux.watsup:238.1-238.23 - def memsxt([]) = [] - ;; 2-syntax-aux.watsup:239.1-239.44 - def {et* : externtype*, mt : memtype} memsxt([MEM_externtype(mt)] :: et*{et}) = [mt] :: $memsxt(et*{et}) ;; 2-syntax-aux.watsup:240.1-240.57 def {et* : externtype*, externtype : externtype} memsxt([externtype] :: et*{et}) = $memsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:239.1-239.44 + def {et* : externtype*, mt : memtype} memsxt([MEM_externtype(mt)] :: et*{et}) = [mt] :: $memsxt(et*{et}) + ;; 2-syntax-aux.watsup:238.1-238.23 + def memsxt([]) = [] } ;; 2-syntax-aux.watsup:249.1-249.33 @@ -21690,12 +21833,12 @@ def s33_to_u32 : s33 -> u32 ;; 3-numerics.watsup:12.1-12.57 def signed : (N, nat) -> int - ;; 3-numerics.watsup:13.1-13.54 - def {N : N, i : nat} signed(N, i) = (i <: int) - -- if (0 <= (2 ^ (N - 1))) ;; 3-numerics.watsup:14.1-14.60 def {N : N, i : nat} signed(N, i) = ((i - (2 ^ N)) <: int) -- if (((2 ^ (N - 1)) <= i) /\ (i < (2 ^ N))) + ;; 3-numerics.watsup:13.1-13.54 + def {N : N, i : nat} signed(N, i) = (i <: int) + -- if (0 <= (2 ^ (N - 1))) ;; 3-numerics.watsup:16.1-16.63 def invsigned : (N, int) -> nat @@ -22123,45 +22266,45 @@ def inst_reftype : (moduleinst, reftype) -> reftype ;; 5-runtime-aux.watsup:19.1-19.52 def default : valtype -> val? - ;; 5-runtime-aux.watsup:21.1-21.34 - def default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) - ;; 5-runtime-aux.watsup:22.1-22.34 - def default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) - ;; 5-runtime-aux.watsup:23.1-23.34 - def default(F32_valtype) = ?(CONST_val(F32_numtype, 0)) - ;; 5-runtime-aux.watsup:24.1-24.34 - def default(F64_valtype) = ?(CONST_val(F64_numtype, 0)) - ;; 5-runtime-aux.watsup:25.1-25.42 - def {ht : heaptype} default(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) ;; 5-runtime-aux.watsup:26.1-26.31 def {ht : heaptype} default(REF_valtype(`NULL%?`(?()), ht)) = ?() + ;; 5-runtime-aux.watsup:25.1-25.42 + def {ht : heaptype} default(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) + ;; 5-runtime-aux.watsup:24.1-24.34 + def default(F64_valtype) = ?(CONST_val(F64_numtype, 0)) + ;; 5-runtime-aux.watsup:23.1-23.34 + def default(F32_valtype) = ?(CONST_val(F32_numtype, 0)) + ;; 5-runtime-aux.watsup:22.1-22.34 + def default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) + ;; 5-runtime-aux.watsup:21.1-21.34 + def default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) ;; 5-runtime-aux.watsup:31.1-31.73 def packval : (storagetype, val) -> fieldval - ;; 5-runtime-aux.watsup:34.1-34.27 - def {t : valtype, val : val} packval($storagetype_valtype(t), val) = $fieldval_val(val) ;; 5-runtime-aux.watsup:35.1-35.70 def {i : nat, pt : packedtype} packval($storagetype_packedtype(pt), CONST_val(I32_numtype, i)) = PACK_fieldval(pt, $wrap(32, $packedsize(pt), i)) + ;; 5-runtime-aux.watsup:34.1-34.27 + def {t : valtype, val : val} packval($storagetype_valtype(t), val) = $fieldval_val(val) ;; 5-runtime-aux.watsup:32.1-32.83 def unpackval : (storagetype, sx?, fieldval) -> val - ;; 5-runtime-aux.watsup:37.1-37.34 - def {t : valtype, val : val} unpackval($storagetype_valtype(t), ?(), $fieldval_val(val)) = val ;; 5-runtime-aux.watsup:38.1-38.79 def {i : nat, pt : packedtype, sx : sx} unpackval($storagetype_packedtype(pt), ?(sx), PACK_fieldval(pt, i)) = CONST_val(I32_numtype, $ext($packedsize(pt), 32, sx, i)) + ;; 5-runtime-aux.watsup:37.1-37.34 + def {t : valtype, val : val} unpackval($storagetype_valtype(t), ?(), $fieldval_val(val)) = val ;; 5-runtime-aux.watsup:43.1-43.62 rec { ;; 5-runtime-aux.watsup:43.1-43.62 def funcsxv : externval* -> funcaddr* - ;; 5-runtime-aux.watsup:48.1-48.24 - def funcsxv([]) = [] - ;; 5-runtime-aux.watsup:49.1-49.47 - def {fa : funcaddr, xv* : externval*} funcsxv([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) ;; 5-runtime-aux.watsup:50.1-50.58 def {externval : externval, xv* : externval*} funcsxv([externval] :: xv*{xv}) = $funcsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:49.1-49.47 + def {fa : funcaddr, xv* : externval*} funcsxv([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:48.1-48.24 + def funcsxv([]) = [] } ;; 5-runtime-aux.watsup:44.1-44.64 @@ -22169,13 +22312,13 @@ rec { ;; 5-runtime-aux.watsup:44.1-44.64 def globalsxv : externval* -> globaladdr* - ;; 5-runtime-aux.watsup:52.1-52.26 - def globalsxv([]) = [] - ;; 5-runtime-aux.watsup:53.1-53.53 - def {ga : globaladdr, xv* : externval*} globalsxv([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) ;; 5-runtime-aux.watsup:54.1-54.62 def {externval : externval, xv* : externval*} globalsxv([externval] :: xv*{xv}) = $globalsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:53.1-53.53 + def {ga : globaladdr, xv* : externval*} globalsxv([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:52.1-52.26 + def globalsxv([]) = [] } ;; 5-runtime-aux.watsup:45.1-45.63 @@ -22183,13 +22326,13 @@ rec { ;; 5-runtime-aux.watsup:45.1-45.63 def tablesxv : externval* -> tableaddr* - ;; 5-runtime-aux.watsup:56.1-56.25 - def tablesxv([]) = [] - ;; 5-runtime-aux.watsup:57.1-57.50 - def {ta : tableaddr, xv* : externval*} tablesxv([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) ;; 5-runtime-aux.watsup:58.1-58.60 def {externval : externval, xv* : externval*} tablesxv([externval] :: xv*{xv}) = $tablesxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:57.1-57.50 + def {ta : tableaddr, xv* : externval*} tablesxv([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) + ;; 5-runtime-aux.watsup:56.1-56.25 + def tablesxv([]) = [] } ;; 5-runtime-aux.watsup:46.1-46.61 @@ -22197,13 +22340,13 @@ rec { ;; 5-runtime-aux.watsup:46.1-46.61 def memsxv : externval* -> memaddr* - ;; 5-runtime-aux.watsup:60.1-60.23 - def memsxv([]) = [] - ;; 5-runtime-aux.watsup:61.1-61.44 - def {ma : memaddr, xv* : externval*} memsxv([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) ;; 5-runtime-aux.watsup:62.1-62.56 def {externval : externval, xv* : externval*} memsxv([externval] :: xv*{xv}) = $memsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:61.1-61.44 + def {ma : memaddr, xv* : externval*} memsxv([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:60.1-60.23 + def memsxv([]) = [] } ;; 5-runtime-aux.watsup:72.1-72.57 @@ -22405,10 +22548,10 @@ rec { ;; 6-typing.watsup:26.1-26.86 def with_locals : (context, localidx*, localtype*) -> context - ;; 6-typing.watsup:28.1-28.34 - def {C : context} with_locals(C, [], []) = C ;; 6-typing.watsup:29.1-29.85 def {C : context, lt* : localtype*, lt_1 : localtype, x* : idx*, x_1 : idx} with_locals(C, [x_1] :: x*{x}, [lt_1] :: lt*{lt}) = $with_locals(C[LOCAL_context[x_1] = lt_1], x*{x}, lt*{lt}) + ;; 6-typing.watsup:28.1-28.34 + def {C : context} with_locals(C, [], []) = C } ;; 6-typing.watsup:33.1-33.65 @@ -22416,11 +22559,11 @@ rec { ;; 6-typing.watsup:33.1-33.65 def clostypes : deftype* -> deftype* - ;; 6-typing.watsup:37.1-37.26 - def clostypes([]) = [] ;; 6-typing.watsup:38.1-38.93 def {dt* : deftype*, dt'* : deftype*, dt_N : deftype} clostypes(dt*{dt} :: [dt_N]) = dt'*{dt'} :: [$subst_all_deftype(dt_N, $heaptype_deftype(dt')*{dt'})] -- if (dt'*{dt'} = $clostypes(dt*{dt})) + ;; 6-typing.watsup:37.1-37.26 + def clostypes([]) = [] } ;; 6-typing.watsup:32.1-32.65 @@ -22443,9 +22586,11 @@ relation Vectype_ok: `%|-%:OK`(context, vectype) ;; 6-typing.watsup:49.1-49.72 relation Heaptype_ok: `%|-%:OK`(context, heaptype) - ;; 6-typing.watsup:60.1-61.24 - rule abs {C : context, absheaptype : absheaptype}: - `%|-%:OK`(C, $heaptype_absheaptype(absheaptype)) + ;; 6-typing.watsup:67.1-69.22 + rule rec {C : context, i : nat, st : subtype}: + `%|-%:OK`(C, REC_heaptype(i)) + -- if (i < |C.REC_context|) + -- if (C.REC_context[i] = st) ;; 6-typing.watsup:63.1-65.23 rule typeidx {C : context, dt : deftype, x : idx}: @@ -22453,11 +22598,9 @@ relation Heaptype_ok: `%|-%:OK`(context, heaptype) -- if (x < |C.TYPE_context|) -- if (C.TYPE_context[x] = dt) - ;; 6-typing.watsup:67.1-69.22 - rule rec {C : context, i : nat, st : subtype}: - `%|-%:OK`(C, REC_heaptype(i)) - -- if (i < |C.REC_context|) - -- if (C.REC_context[i] = st) + ;; 6-typing.watsup:60.1-61.24 + rule abs {C : context, absheaptype : absheaptype}: + `%|-%:OK`(C, $heaptype_absheaptype(absheaptype)) ;; 6-typing.watsup:50.1-50.71 relation Reftype_ok: `%|-%:OK`(context, reftype) @@ -22468,24 +22611,24 @@ relation Reftype_ok: `%|-%:OK`(context, reftype) ;; 6-typing.watsup:51.1-51.71 relation Valtype_ok: `%|-%:OK`(context, valtype) - ;; 6-typing.watsup:75.1-77.35 - rule num {C : context, numtype : numtype}: - `%|-%:OK`(C, $valtype_numtype(numtype)) - -- Numtype_ok: `%|-%:OK`(C, numtype) - - ;; 6-typing.watsup:79.1-81.35 - rule vec {C : context, vectype : vectype}: - `%|-%:OK`(C, $valtype_vectype(vectype)) - -- Vectype_ok: `%|-%:OK`(C, vectype) + ;; 6-typing.watsup:87.1-88.16 + rule bot {C : context}: + `%|-%:OK`(C, BOT_valtype) ;; 6-typing.watsup:83.1-85.35 rule ref {C : context, reftype : reftype}: `%|-%:OK`(C, $valtype_reftype(reftype)) -- Reftype_ok: `%|-%:OK`(C, reftype) - ;; 6-typing.watsup:87.1-88.16 - rule bot {C : context}: - `%|-%:OK`(C, BOT_valtype) + ;; 6-typing.watsup:79.1-81.35 + rule vec {C : context, vectype : vectype}: + `%|-%:OK`(C, $valtype_vectype(vectype)) + -- Vectype_ok: `%|-%:OK`(C, vectype) + + ;; 6-typing.watsup:75.1-77.35 + rule num {C : context, numtype : numtype}: + `%|-%:OK`(C, $valtype_numtype(numtype)) + -- Numtype_ok: `%|-%:OK`(C, numtype) ;; 6-typing.watsup:93.1-93.74 relation Resulttype_ok: `%|-%:OK`(context, resulttype) @@ -22521,16 +22664,16 @@ relation Packedtype_ok: `%|-%:OK`(context, packedtype) ;; 6-typing.watsup:114.1-114.77 relation Storagetype_ok: `%|-%:OK`(context, storagetype) - ;; 6-typing.watsup:131.1-133.35 - rule val {C : context, valtype : valtype}: - `%|-%:OK`(C, $storagetype_valtype(valtype)) - -- Valtype_ok: `%|-%:OK`(C, valtype) - ;; 6-typing.watsup:135.1-137.41 rule packed {C : context, packedtype : packedtype}: `%|-%:OK`(C, $storagetype_packedtype(packedtype)) -- Packedtype_ok: `%|-%:OK`(C, packedtype) + ;; 6-typing.watsup:131.1-133.35 + rule val {C : context, valtype : valtype}: + `%|-%:OK`(C, $storagetype_valtype(valtype)) + -- Valtype_ok: `%|-%:OK`(C, valtype) + ;; 6-typing.watsup:113.1-113.75 relation Fieldtype_ok: `%|-%:OK`(context, fieldtype) ;; 6-typing.watsup:139.1-141.34 @@ -22548,20 +22691,20 @@ relation Functype_ok: `%|-%:OK`(context, functype) ;; 6-typing.watsup:115.1-115.74 relation Comptype_ok: `%|-%:OK`(context, comptype) - ;; 6-typing.watsup:144.1-146.35 - rule struct {C : context, yt* : fieldtype*}: - `%|-%:OK`(C, STRUCT_comptype(yt*{yt})) - -- (Fieldtype_ok: `%|-%:OK`(C, yt))*{yt} + ;; 6-typing.watsup:152.1-154.31 + rule func {C : context, ft : functype}: + `%|-%:OK`(C, FUNC_comptype(ft)) + -- Functype_ok: `%|-%:OK`(C, ft) ;; 6-typing.watsup:148.1-150.32 rule array {C : context, yt : fieldtype}: `%|-%:OK`(C, ARRAY_comptype(yt)) -- Fieldtype_ok: `%|-%:OK`(C, yt) - ;; 6-typing.watsup:152.1-154.31 - rule func {C : context, ft : functype}: - `%|-%:OK`(C, FUNC_comptype(ft)) - -- Functype_ok: `%|-%:OK`(C, ft) + ;; 6-typing.watsup:144.1-146.35 + rule struct {C : context, yt* : fieldtype*}: + `%|-%:OK`(C, STRUCT_comptype(yt*{yt})) + -- (Fieldtype_ok: `%|-%:OK`(C, yt))*{yt} ;; 6-typing.watsup:391.1-391.91 relation Packedtype_sub: `%|-%<:%`(context, packedtype, packedtype) @@ -22580,116 +22723,116 @@ rec { ;; 6-typing.watsup:125.1-125.75 relation Deftype_sub: `%|-%<:%`(context, deftype, deftype) - ;; 6-typing.watsup:434.1-436.58 - rule refl {C : context, deftype_1 : deftype, deftype_2 : deftype}: - `%|-%<:%`(C, deftype_1, deftype_2) - -- if ($clostype(C, deftype_1) = $clostype(C, deftype_2)) - ;; 6-typing.watsup:438.1-441.40 rule super {C : context, ct : comptype, deftype_1 : deftype, deftype_2 : deftype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*}: `%|-%<:%`(C, deftype_1, deftype_2) -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) -- Heaptype_sub: `%|-%<:%`(C, ht, $heaptype_deftype(deftype_2)) + ;; 6-typing.watsup:434.1-436.58 + rule refl {C : context, deftype_1 : deftype, deftype_2 : deftype}: + `%|-%<:%`(C, deftype_1, deftype_2) + -- if ($clostype(C, deftype_1) = $clostype(C, deftype_2)) + ;; 6-typing.watsup:271.1-271.79 relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) - ;; 6-typing.watsup:282.1-283.28 - rule refl {C : context, heaptype : heaptype}: - `%|-%<:%`(C, heaptype, heaptype) + ;; 6-typing.watsup:343.1-344.23 + rule bot {C : context, heaptype : heaptype}: + `%|-%<:%`(C, BOT_heaptype, heaptype) - ;; 6-typing.watsup:285.1-289.48 - rule trans {C : context, heaptype' : heaptype, heaptype_1 : heaptype, heaptype_2 : heaptype}: - `%|-%<:%`(C, heaptype_1, heaptype_2) - -- Heaptype_ok: `%|-%:OK`(C, heaptype') - -- Heaptype_sub: `%|-%<:%`(C, heaptype_1, heaptype') - -- Heaptype_sub: `%|-%<:%`(C, heaptype', heaptype_2) + ;; 6-typing.watsup:339.1-341.43 + rule noextern {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NOEXTERN_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, EXTERN_heaptype) - ;; 6-typing.watsup:291.1-292.17 - rule eq-any {C : context}: - `%|-%<:%`(C, EQ_heaptype, ANY_heaptype) + ;; 6-typing.watsup:335.1-337.41 + rule nofunc {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NOFUNC_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, FUNC_heaptype) - ;; 6-typing.watsup:294.1-295.17 - rule i31-eq {C : context}: - `%|-%<:%`(C, I31_heaptype, EQ_heaptype) + ;; 6-typing.watsup:331.1-333.40 + rule none {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NONE_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, ANY_heaptype) - ;; 6-typing.watsup:297.1-298.20 - rule struct-eq {C : context}: - `%|-%<:%`(C, STRUCT_heaptype, EQ_heaptype) + ;; 6-typing.watsup:327.1-329.48 + rule rec {C : context, ct : comptype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*, i : nat}: + `%|-%<:%`(C, REC_heaptype(i), ht) + -- if (i < |C.REC_context|) + -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) - ;; 6-typing.watsup:300.1-301.19 - rule array-eq {C : context}: - `%|-%<:%`(C, ARRAY_heaptype, EQ_heaptype) + ;; 6-typing.watsup:323.1-325.52 + rule typeidx-r {C : context, heaptype : heaptype, typeidx : typeidx}: + `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) + -- if (typeidx < |C.TYPE_context|) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, $heaptype_deftype(C.TYPE_context[typeidx])) - ;; 6-typing.watsup:303.1-305.35 - rule struct {C : context, deftype : deftype, yt* : fieldtype*}: - `%|-%<:%`(C, $heaptype_deftype(deftype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) + ;; 6-typing.watsup:319.1-321.52 + rule typeidx-l {C : context, heaptype : heaptype, typeidx : typeidx}: + `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) + -- if (typeidx < |C.TYPE_context|) + -- Heaptype_sub: `%|-%<:%`(C, $heaptype_deftype(C.TYPE_context[typeidx]), heaptype) - ;; 6-typing.watsup:307.1-309.33 - rule array {C : context, deftype : deftype, yt : fieldtype}: - `%|-%<:%`(C, $heaptype_deftype(deftype), ARRAY_heaptype) - -- Expand: `%~~%`(deftype, ARRAY_comptype(yt)) + ;; 6-typing.watsup:315.1-317.46 + rule def {C : context, deftype_1 : deftype, deftype_2 : deftype}: + `%|-%<:%`(C, $heaptype_deftype(deftype_1), $heaptype_deftype(deftype_2)) + -- Deftype_sub: `%|-%<:%`(C, deftype_1, deftype_2) ;; 6-typing.watsup:311.1-313.32 rule func {C : context, deftype : deftype, ft : functype}: `%|-%<:%`(C, $heaptype_deftype(deftype), FUNC_heaptype) -- Expand: `%~~%`(deftype, FUNC_comptype(ft)) - ;; 6-typing.watsup:315.1-317.46 - rule def {C : context, deftype_1 : deftype, deftype_2 : deftype}: - `%|-%<:%`(C, $heaptype_deftype(deftype_1), $heaptype_deftype(deftype_2)) - -- Deftype_sub: `%|-%<:%`(C, deftype_1, deftype_2) + ;; 6-typing.watsup:307.1-309.33 + rule array {C : context, deftype : deftype, yt : fieldtype}: + `%|-%<:%`(C, $heaptype_deftype(deftype), ARRAY_heaptype) + -- Expand: `%~~%`(deftype, ARRAY_comptype(yt)) - ;; 6-typing.watsup:319.1-321.52 - rule typeidx-l {C : context, heaptype : heaptype, typeidx : typeidx}: - `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) - -- if (typeidx < |C.TYPE_context|) - -- Heaptype_sub: `%|-%<:%`(C, $heaptype_deftype(C.TYPE_context[typeidx]), heaptype) + ;; 6-typing.watsup:303.1-305.35 + rule struct {C : context, deftype : deftype, yt* : fieldtype*}: + `%|-%<:%`(C, $heaptype_deftype(deftype), STRUCT_heaptype) + -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) - ;; 6-typing.watsup:323.1-325.52 - rule typeidx-r {C : context, heaptype : heaptype, typeidx : typeidx}: - `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) - -- if (typeidx < |C.TYPE_context|) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, $heaptype_deftype(C.TYPE_context[typeidx])) + ;; 6-typing.watsup:300.1-301.19 + rule array-eq {C : context}: + `%|-%<:%`(C, ARRAY_heaptype, EQ_heaptype) - ;; 6-typing.watsup:327.1-329.48 - rule rec {C : context, ct : comptype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*, i : nat}: - `%|-%<:%`(C, REC_heaptype(i), ht) - -- if (i < |C.REC_context|) - -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + ;; 6-typing.watsup:297.1-298.20 + rule struct-eq {C : context}: + `%|-%<:%`(C, STRUCT_heaptype, EQ_heaptype) - ;; 6-typing.watsup:331.1-333.40 - rule none {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NONE_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, ANY_heaptype) + ;; 6-typing.watsup:294.1-295.17 + rule i31-eq {C : context}: + `%|-%<:%`(C, I31_heaptype, EQ_heaptype) - ;; 6-typing.watsup:335.1-337.41 - rule nofunc {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NOFUNC_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, FUNC_heaptype) + ;; 6-typing.watsup:291.1-292.17 + rule eq-any {C : context}: + `%|-%<:%`(C, EQ_heaptype, ANY_heaptype) - ;; 6-typing.watsup:339.1-341.43 - rule noextern {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NOEXTERN_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, EXTERN_heaptype) + ;; 6-typing.watsup:285.1-289.48 + rule trans {C : context, heaptype' : heaptype, heaptype_1 : heaptype, heaptype_2 : heaptype}: + `%|-%<:%`(C, heaptype_1, heaptype_2) + -- Heaptype_ok: `%|-%:OK`(C, heaptype') + -- Heaptype_sub: `%|-%<:%`(C, heaptype_1, heaptype') + -- Heaptype_sub: `%|-%<:%`(C, heaptype', heaptype_2) - ;; 6-typing.watsup:343.1-344.23 - rule bot {C : context, heaptype : heaptype}: - `%|-%<:%`(C, BOT_heaptype, heaptype) + ;; 6-typing.watsup:282.1-283.28 + rule refl {C : context, heaptype : heaptype}: + `%|-%<:%`(C, heaptype, heaptype) } ;; 6-typing.watsup:272.1-272.78 relation Reftype_sub: `%|-%<:%`(context, reftype, reftype) - ;; 6-typing.watsup:347.1-349.37 - rule nonnull {C : context, ht_1 : heaptype, ht_2 : heaptype}: - `%|-%<:%`(C, REF_reftype(`NULL%?`(?()), ht_1), REF_reftype(`NULL%?`(?()), ht_2)) - -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) - ;; 6-typing.watsup:351.1-353.37 rule null {C : context, ht_1 : heaptype, ht_2 : heaptype, w0 : ()?}: `%|-%<:%`(C, REF_reftype(`NULL%?`(w0), ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) + ;; 6-typing.watsup:347.1-349.37 + rule nonnull {C : context, ht_1 : heaptype, ht_2 : heaptype}: + `%|-%<:%`(C, REF_reftype(`NULL%?`(?()), ht_1), REF_reftype(`NULL%?`(?()), ht_2)) + -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) + ;; 6-typing.watsup:270.1-270.78 relation Vectype_sub: `%|-%<:%`(context, vectype, vectype) ;; 6-typing.watsup:278.1-279.26 @@ -22698,50 +22841,50 @@ relation Vectype_sub: `%|-%<:%`(context, vectype, vectype) ;; 6-typing.watsup:273.1-273.78 relation Valtype_sub: `%|-%<:%`(context, valtype, valtype) - ;; 6-typing.watsup:356.1-358.46 - rule num {C : context, numtype_1 : numtype, numtype_2 : numtype}: - `%|-%<:%`(C, $valtype_numtype(numtype_1), $valtype_numtype(numtype_2)) - -- Numtype_sub: `%|-%<:%`(C, numtype_1, numtype_2) - - ;; 6-typing.watsup:360.1-362.46 - rule vec {C : context, vectype_1 : vectype, vectype_2 : vectype}: - `%|-%<:%`(C, $valtype_vectype(vectype_1), $valtype_vectype(vectype_2)) - -- Vectype_sub: `%|-%<:%`(C, vectype_1, vectype_2) + ;; 6-typing.watsup:368.1-369.22 + rule bot {C : context, valtype : valtype}: + `%|-%<:%`(C, BOT_valtype, valtype) ;; 6-typing.watsup:364.1-366.46 rule ref {C : context, reftype_1 : reftype, reftype_2 : reftype}: `%|-%<:%`(C, $valtype_reftype(reftype_1), $valtype_reftype(reftype_2)) -- Reftype_sub: `%|-%<:%`(C, reftype_1, reftype_2) - ;; 6-typing.watsup:368.1-369.22 - rule bot {C : context, valtype : valtype}: - `%|-%<:%`(C, BOT_valtype, valtype) + ;; 6-typing.watsup:360.1-362.46 + rule vec {C : context, vectype_1 : vectype, vectype_2 : vectype}: + `%|-%<:%`(C, $valtype_vectype(vectype_1), $valtype_vectype(vectype_2)) + -- Vectype_sub: `%|-%<:%`(C, vectype_1, vectype_2) + + ;; 6-typing.watsup:356.1-358.46 + rule num {C : context, numtype_1 : numtype, numtype_2 : numtype}: + `%|-%<:%`(C, $valtype_numtype(numtype_1), $valtype_numtype(numtype_2)) + -- Numtype_sub: `%|-%<:%`(C, numtype_1, numtype_2) ;; 6-typing.watsup:392.1-392.92 relation Storagetype_sub: `%|-%<:%`(context, storagetype, storagetype) - ;; 6-typing.watsup:402.1-404.46 - rule val {C : context, valtype_1 : valtype, valtype_2 : valtype}: - `%|-%<:%`(C, $storagetype_valtype(valtype_1), $storagetype_valtype(valtype_2)) - -- Valtype_sub: `%|-%<:%`(C, valtype_1, valtype_2) - ;; 6-typing.watsup:406.1-408.55 rule packed {C : context, packedtype_1 : packedtype, packedtype_2 : packedtype}: `%|-%<:%`(C, $storagetype_packedtype(packedtype_1), $storagetype_packedtype(packedtype_2)) -- Packedtype_sub: `%|-%<:%`(C, packedtype_1, packedtype_2) + ;; 6-typing.watsup:402.1-404.46 + rule val {C : context, valtype_1 : valtype, valtype_2 : valtype}: + `%|-%<:%`(C, $storagetype_valtype(valtype_1), $storagetype_valtype(valtype_2)) + -- Valtype_sub: `%|-%<:%`(C, valtype_1, valtype_2) + ;; 6-typing.watsup:393.1-393.90 relation Fieldtype_sub: `%|-%<:%`(context, fieldtype, fieldtype) - ;; 6-typing.watsup:411.1-413.40 - rule const {C : context, zt_1 : storagetype, zt_2 : storagetype}: - `%|-%<:%`(C, `%%`(`MUT%?`(?()), zt_1), `%%`(`MUT%?`(?()), zt_2)) - -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) - ;; 6-typing.watsup:415.1-418.40 rule var {C : context, zt_1 : storagetype, zt_2 : storagetype}: `%|-%<:%`(C, `%%`(`MUT%?`(?(())), zt_1), `%%`(`MUT%?`(?(())), zt_2)) -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) + ;; 6-typing.watsup:411.1-413.40 + rule const {C : context, zt_1 : storagetype, zt_2 : storagetype}: + `%|-%<:%`(C, `%%`(`MUT%?`(?()), zt_1), `%%`(`MUT%?`(?()), zt_2)) + -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) + ;; 6-typing.watsup:395.1-395.89 relation Functype_sub: `%|-%<:%`(context, functype, functype) ;; 6-typing.watsup:458.1-459.16 @@ -22750,22 +22893,22 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) ;; 6-typing.watsup:124.1-124.76 relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) - ;; 6-typing.watsup:421.1-423.41 - rule struct {C : context, yt'_1 : fieldtype, yt_1* : fieldtype*, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) - -- if (|yt_1*{yt_1}| = |yt_2*{yt_2}|) - -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} - - ;; 6-typing.watsup:425.1-427.38 - rule array {C : context, yt_1 : fieldtype, yt_2 : fieldtype}: - `%|-%<:%`(C, ARRAY_comptype(yt_1), ARRAY_comptype(yt_2)) - -- Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2) - ;; 6-typing.watsup:429.1-431.37 rule func {C : context, ft_1 : functype, ft_2 : functype}: `%|-%<:%`(C, FUNC_comptype(ft_1), FUNC_comptype(ft_2)) -- Functype_sub: `%|-%<:%`(C, ft_1, ft_2) + ;; 6-typing.watsup:425.1-427.38 + rule array {C : context, yt_1 : fieldtype, yt_2 : fieldtype}: + `%|-%<:%`(C, ARRAY_comptype(yt_1), ARRAY_comptype(yt_2)) + -- Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2) + + ;; 6-typing.watsup:421.1-423.41 + rule struct {C : context, yt'_1 : fieldtype, yt_1* : fieldtype*, yt_2* : fieldtype*}: + `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) + -- if (|yt_1*{yt_1}| = |yt_2*{yt_2}|) + -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} + ;; 6-typing.watsup:117.1-117.73 relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) ;; 6-typing.watsup:157.1-163.37 @@ -22782,21 +22925,21 @@ relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) ;; 6-typing.watsup:165.1-165.65 def before : (heaptype, typeidx, nat) -> bool - ;; 6-typing.watsup:166.1-166.34 - def {deftype : deftype, i : nat, x : idx} before($heaptype_deftype(deftype), x, i) = true - ;; 6-typing.watsup:167.1-167.46 - def {i : nat, typeidx : typeidx, x : idx} before(_IDX_heaptype(typeidx), x, i) = (typeidx < x) ;; 6-typing.watsup:168.1-168.33 def {i : nat, j : nat, x : idx} before(REC_heaptype(j), x, i) = (j < i) + ;; 6-typing.watsup:167.1-167.46 + def {i : nat, typeidx : typeidx, x : idx} before(_IDX_heaptype(typeidx), x, i) = (typeidx < x) + ;; 6-typing.watsup:166.1-166.34 + def {deftype : deftype, i : nat, x : idx} before($heaptype_deftype(deftype), x, i) = true ;; 6-typing.watsup:170.1-170.69 def unrollht : (context, heaptype) -> subtype - ;; 6-typing.watsup:171.1-171.47 - def {C : context, deftype : deftype} unrollht(C, $heaptype_deftype(deftype)) = $unrolldt(deftype) - ;; 6-typing.watsup:172.1-172.60 - def {C : context, typeidx : typeidx} unrollht(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx]) ;; 6-typing.watsup:173.1-173.35 def {C : context, i : nat} unrollht(C, REC_heaptype(i)) = C.REC_context[i] + ;; 6-typing.watsup:172.1-172.60 + def {C : context, typeidx : typeidx} unrollht(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx]) + ;; 6-typing.watsup:171.1-171.47 + def {C : context, deftype : deftype} unrollht(C, $heaptype_deftype(deftype)) = $unrolldt(deftype) ;; 6-typing.watsup:119.1-119.76 relation Subtype_ok2: `%|-%:%`(context, subtype, oktypeidxnat) @@ -22816,15 +22959,15 @@ rec { ;; 6-typing.watsup:120.1-120.76 relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) - ;; 6-typing.watsup:196.1-197.24 - rule empty {C : context, i : nat, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) - ;; 6-typing.watsup:199.1-202.50 rule cons {C : context, i : nat, st* : subtype*, st_1 : subtype, x : idx}: `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidxnat((x + 1), (i + 1))) + + ;; 6-typing.watsup:196.1-197.24 + rule empty {C : context, i : nat, x : idx}: + `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) } ;; 6-typing.watsup:118.1-118.74 @@ -22832,9 +22975,10 @@ rec { ;; 6-typing.watsup:118.1-118.74 relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) - ;; 6-typing.watsup:184.1-185.23 - rule empty {C : context, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) + ;; 6-typing.watsup:192.1-194.49 + rule rec2 {C : context, st* : subtype*, x : idx}: + `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) ;; 6-typing.watsup:187.1-190.43 rule cons {C : context, st* : subtype*, st_1 : subtype, x : idx}: @@ -22842,10 +22986,9 @@ relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x + 1)) - ;; 6-typing.watsup:192.1-194.49 - rule rec2 {C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) + ;; 6-typing.watsup:184.1-185.23 + rule empty {C : context, x : idx}: + `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) } ;; 6-typing.watsup:121.1-121.73 @@ -22888,26 +23031,26 @@ relation Memtype_ok: `%|-%:OK`(context, memtype) ;; 6-typing.watsup:218.1-218.74 relation Externtype_ok: `%|-%:OK`(context, externtype) - ;; 6-typing.watsup:244.1-247.27 - rule func {C : context, dt : deftype, ft : functype}: - `%|-%:OK`(C, FUNC_externtype(dt)) - -- Deftype_ok: `%|-%:OK`(C, dt) - -- Expand: `%~~%`(dt, FUNC_comptype(ft)) - - ;; 6-typing.watsup:249.1-251.33 - rule global {C : context, gt : globaltype}: - `%|-%:OK`(C, GLOBAL_externtype(gt)) - -- Globaltype_ok: `%|-%:OK`(C, gt) + ;; 6-typing.watsup:257.1-259.30 + rule mem {C : context, mt : memtype}: + `%|-%:OK`(C, MEM_externtype(mt)) + -- Memtype_ok: `%|-%:OK`(C, mt) ;; 6-typing.watsup:253.1-255.32 rule table {C : context, tt : tabletype}: `%|-%:OK`(C, TABLE_externtype(tt)) -- Tabletype_ok: `%|-%:OK`(C, tt) - ;; 6-typing.watsup:257.1-259.30 - rule mem {C : context, mt : memtype}: - `%|-%:OK`(C, MEM_externtype(mt)) - -- Memtype_ok: `%|-%:OK`(C, mt) + ;; 6-typing.watsup:249.1-251.33 + rule global {C : context, gt : globaltype}: + `%|-%:OK`(C, GLOBAL_externtype(gt)) + -- Globaltype_ok: `%|-%:OK`(C, gt) + + ;; 6-typing.watsup:244.1-247.27 + rule func {C : context, dt : deftype, ft : functype}: + `%|-%:OK`(C, FUNC_externtype(dt)) + -- Deftype_ok: `%|-%:OK`(C, dt) + -- Expand: `%~~%`(dt, FUNC_comptype(ft)) ;; 6-typing.watsup:374.1-374.81 relation Resulttype_sub: `%|-%*<:%*`(context, valtype*, valtype*) @@ -22939,17 +23082,17 @@ relation Limits_sub: `%|-%<:%`(context, limits, limits) ;; 6-typing.watsup:447.1-447.83 relation Globaltype_sub: `%|-%<:%`(context, globaltype, globaltype) - ;; 6-typing.watsup:461.1-463.34 - rule const {C : context, t_1 : valtype, t_2 : valtype}: - `%|-%<:%`(C, `%%`(`MUT%?`(?()), t_1), `%%`(`MUT%?`(?()), t_2)) - -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) - ;; 6-typing.watsup:465.1-468.34 rule var {C : context, t_1 : valtype, t_2 : valtype}: `%|-%<:%`(C, `%%`(`MUT%?`(?(())), t_1), `%%`(`MUT%?`(?(())), t_2)) -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) -- Valtype_sub: `%|-%<:%`(C, t_2, t_1) + ;; 6-typing.watsup:461.1-463.34 + rule const {C : context, t_1 : valtype, t_2 : valtype}: + `%|-%<:%`(C, `%%`(`MUT%?`(?()), t_1), `%%`(`MUT%?`(?()), t_2)) + -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) + ;; 6-typing.watsup:448.1-448.82 relation Tabletype_sub: `%|-%<:%`(context, tabletype, tabletype) ;; 6-typing.watsup:470.1-474.36 @@ -22968,312 +23111,278 @@ relation Memtype_sub: `%|-%<:%`(context, memtype, memtype) ;; 6-typing.watsup:450.1-450.83 relation Externtype_sub: `%|-%<:%`(context, externtype, externtype) - ;; 6-typing.watsup:481.1-483.36 - rule func {C : context, dt_1 : deftype, dt_2 : deftype}: - `%|-%<:%`(C, FUNC_externtype(dt_1), FUNC_externtype(dt_2)) - -- Deftype_sub: `%|-%<:%`(C, dt_1, dt_2) - - ;; 6-typing.watsup:485.1-487.39 - rule global {C : context, gt_1 : globaltype, gt_2 : globaltype}: - `%|-%<:%`(C, GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) - -- Globaltype_sub: `%|-%<:%`(C, gt_1, gt_2) + ;; 6-typing.watsup:493.1-495.36 + rule mem {C : context, mt_1 : memtype, mt_2 : memtype}: + `%|-%<:%`(C, MEM_externtype(mt_1), MEM_externtype(mt_2)) + -- Memtype_sub: `%|-%<:%`(C, mt_1, mt_2) ;; 6-typing.watsup:489.1-491.38 rule table {C : context, tt_1 : tabletype, tt_2 : tabletype}: `%|-%<:%`(C, TABLE_externtype(tt_1), TABLE_externtype(tt_2)) -- Tabletype_sub: `%|-%<:%`(C, tt_1, tt_2) - ;; 6-typing.watsup:493.1-495.36 - rule mem {C : context, mt_1 : memtype, mt_2 : memtype}: - `%|-%<:%`(C, MEM_externtype(mt_1), MEM_externtype(mt_2)) - -- Memtype_sub: `%|-%<:%`(C, mt_1, mt_2) + ;; 6-typing.watsup:485.1-487.39 + rule global {C : context, gt_1 : globaltype, gt_2 : globaltype}: + `%|-%<:%`(C, GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) + -- Globaltype_sub: `%|-%<:%`(C, gt_1, gt_2) + + ;; 6-typing.watsup:481.1-483.36 + rule func {C : context, dt_1 : deftype, dt_2 : deftype}: + `%|-%<:%`(C, FUNC_externtype(dt_1), FUNC_externtype(dt_2)) + -- Deftype_sub: `%|-%<:%`(C, dt_1, dt_2) ;; 6-typing.watsup:565.1-565.76 relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) - ;; 6-typing.watsup:567.1-568.32 - rule void {C : context}: - `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) - - ;; 6-typing.watsup:570.1-571.28 - rule result {C : context, t : valtype}: - `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`([], [t])) - ;; 6-typing.watsup:573.1-575.34 rule typeidx {C : context, ft : functype, x : idx}: `%|-%:%`(C, _IDX_blocktype(x), ft) -- if (x < |C.TYPE_context|) -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(ft)) + ;; 6-typing.watsup:570.1-571.28 + rule result {C : context, t : valtype}: + `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`([], [t])) + + ;; 6-typing.watsup:567.1-568.32 + rule void {C : context}: + `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) + ;; 6-typing.watsup:503.1-505.74 rec { ;; 6-typing.watsup:503.1-503.67 relation Instr_ok: `%|-%:%`(context, instr, functype) - ;; 6-typing.watsup:544.1-545.34 - rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) - - ;; 6-typing.watsup:547.1-548.24 - rule nop {C : context}: - `%|-%:%`(C, NOP_instr, `%->%`([], [])) + ;; 6-typing.watsup:951.1-956.29 + rule store {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, x : idx, o0 : nat, o1? : nat?}: + `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype $valtype_numtype(nt)], [])) + -- if (x < |C.MEM_context|) + -- if ((n?{n} = ?()) <=> (o1?{o1} = ?())) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- (if ($size($valtype_numtype(nt)) = ?(o1)))?{o1} + -- if (C.MEM_context[x] = mt) + -- if ((2 ^ n_A) <= (o0 / 8)) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} + -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) - ;; 6-typing.watsup:550.1-551.23 - rule drop {C : context, t : valtype}: - `%|-%:%`(C, DROP_instr, `%->%`([t], [])) + ;; 6-typing.watsup:944.1-949.29 + rule load {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, x : idx, o0 : nat, o1? : nat?}: + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [$valtype_numtype(nt)])) + -- if (x < |C.MEM_context|) + -- if ((n?{n} = ?()) <=> (o1?{o1} = ?())) + -- if ((n?{n} = ?()) <=> (sx?{sx} = ?())) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- (if ($size($valtype_numtype(nt)) = ?(o1)))?{o1} + -- if (C.MEM_context[x] = mt) + -- if ((2 ^ n_A) <= (o0 / 8)) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} + -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) - ;; 6-typing.watsup:554.1-555.31 - rule select-expl {C : context, t : valtype}: - `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) + ;; 6-typing.watsup:940.1-942.23 + rule data.drop {C : context, x : idx}: + `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) + -- if (x < |C.DATA_context|) + -- if (C.DATA_context[x] = OK) - ;; 6-typing.watsup:557.1-560.37 - rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: - `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) - -- Valtype_sub: `%|-%<:%`(C, t, t') - -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) + ;; 6-typing.watsup:935.1-938.23 + rule memory.init {C : context, mt : memtype, x : idx, y : idx}: + `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (x < |C.MEM_context|) + -- if (y < |C.DATA_context|) + -- if (C.MEM_context[x] = mt) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:578.1-581.61 - rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:930.1-933.26 + rule memory.copy {C : context, mt_1 : memtype, mt_2 : memtype, x_1 : idx, x_2 : idx}: + `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (x_1 < |C.MEM_context|) + -- if (x_2 < |C.MEM_context|) + -- if (C.MEM_context[x_1] = mt_1) + -- if (C.MEM_context[x_2] = mt_2) - ;; 6-typing.watsup:583.1-586.61 - rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:926.1-928.22 + rule memory.fill {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (x < |C.MEM_context|) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:588.1-592.65 - rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: - `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) + ;; 6-typing.watsup:922.1-924.22 + rule memory.grow {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) + -- if (x < |C.MEM_context|) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:597.1-599.24 - rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (l < |C.LABEL_context|) - -- if (C.LABEL_context[l] = t*{t}) + ;; 6-typing.watsup:918.1-920.22 + rule memory.size {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) + -- if (x < |C.MEM_context|) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:601.1-603.24 - rule br_if {C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) - -- if (l < |C.LABEL_context|) - -- if (C.LABEL_context[l] = t*{t}) + ;; 6-typing.watsup:911.1-913.23 + rule elem.drop {C : context, rt : reftype, x : idx}: + `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) + -- if (x < |C.ELEM_context|) + -- if (C.ELEM_context[x] = rt) - ;; 6-typing.watsup:605.1-608.44 - rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- (if (l < |C.LABEL_context|))*{l} - -- if (l' < |C.LABEL_context|) - -- (Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l]))*{l} - -- Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l']) + ;; 6-typing.watsup:905.1-909.36 + rule table.init {C : context, lim : limits, rt_1 : reftype, rt_2 : reftype, x : idx, y : idx}: + `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (x < |C.TABLE_context|) + -- if (y < |C.ELEM_context|) + -- if (C.TABLE_context[x] = `%%`(lim, rt_1)) + -- if (C.ELEM_context[y] = rt_2) + -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - ;; 6-typing.watsup:610.1-613.31 - rule br_on_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (l < |C.LABEL_context|) - -- if (C.LABEL_context[l] = t*{t}) - -- Heaptype_ok: `%|-%:OK`(C, ht) - - ;; 6-typing.watsup:615.1-618.31 - rule br_on_non_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) - -- if (l < |C.LABEL_context|) - -- if (C.LABEL_context[l] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) - -- Heaptype_ok: `%|-%:OK`(C, ht) - - ;; 6-typing.watsup:620.1-626.34 - rule br_on_cast {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype($diffrt(rt_1, rt_2))])) - -- if (l < |C.LABEL_context|) - -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) - -- Reftype_ok: `%|-%:OK`(C, rt_1) - -- Reftype_ok: `%|-%:OK`(C, rt_2) - -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) - - ;; 6-typing.watsup:628.1-634.49 - rule br_on_cast_fail {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype(rt_2)])) - -- if (l < |C.LABEL_context|) - -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) - -- Reftype_ok: `%|-%:OK`(C, rt_1) - -- Reftype_ok: `%|-%:OK`(C, rt_2) + ;; 6-typing.watsup:899.1-903.36 + rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt_1 : reftype, rt_2 : reftype, x_1 : idx, x_2 : idx}: + `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (x_1 < |C.TABLE_context|) + -- if (x_2 < |C.TABLE_context|) + -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt_1)) + -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt_2)) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) - - ;; 6-typing.watsup:639.1-641.24 - rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.RETURN_context = ?(t*{t})) - - ;; 6-typing.watsup:643.1-645.46 - rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- if (x < |C.FUNC_context|) - -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - - ;; 6-typing.watsup:647.1-649.46 - rule call_ref {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_2*{t_2})) - -- if (x < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:651.1-655.46 - rule call_indirect {C : context, lim : limits, rt : reftype, t_1* : valtype*, t_2* : valtype*, x : idx, y : idx}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + ;; 6-typing.watsup:895.1-897.28 + rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) -- if (x < |C.TABLE_context|) - -- if (y < |C.TYPE_context|) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:657.1-661.40 - rule return_call {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) - -- if (x < |C.FUNC_context|) - -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + ;; 6-typing.watsup:891.1-893.28 + rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) + -- if (x < |C.TABLE_context|) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:663.1-667.40 - rule return_call_ref {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_4*{t_4})) - -- if (x < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + ;; 6-typing.watsup:887.1-889.24 + rule table.size {C : context, tt : tabletype, x : idx}: + `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) + -- if (x < |C.TABLE_context|) + -- if (C.TABLE_context[x] = tt) - ;; 6-typing.watsup:669.1-675.40 - rule return_call_indirect {C : context, lim : limits, rt : reftype, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx, y : idx}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) + ;; 6-typing.watsup:883.1-885.28 + rule table.set {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) -- if (x < |C.TABLE_context|) - -- if (y < |C.TYPE_context|) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:680.1-681.33 - rule const {C : context, c_nt : c, nt : numtype}: - `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) + ;; 6-typing.watsup:879.1-881.28 + rule table.get {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) + -- if (x < |C.TABLE_context|) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:683.1-684.31 - rule unop {C : context, nt : numtype, unop : unop_numtype}: - `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) + ;; 6-typing.watsup:872.1-874.28 + rule global.set {C : context, t : valtype, x : idx}: + `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) + -- if (x < |C.GLOBAL_context|) + -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?(())), t)) - ;; 6-typing.watsup:686.1-687.36 - rule binop {C : context, binop : binop_numtype, nt : numtype}: - `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) + ;; 6-typing.watsup:868.1-870.28 + rule global.get {C : context, mut : mut, t : valtype, x : idx}: + `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) + -- if (x < |C.GLOBAL_context|) + -- if (C.GLOBAL_context[x] = `%%`(mut, t)) - ;; 6-typing.watsup:689.1-690.36 - rule testop {C : context, nt : numtype, testop : testop_numtype}: - `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) + ;; 6-typing.watsup:853.1-855.28 + rule local.get {C : context, init : init, t : valtype, x : idx}: + `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) + -- if (x < |C.LOCAL_context|) + -- if (C.LOCAL_context[x] = `%%`(init, t)) - ;; 6-typing.watsup:692.1-693.37 - rule relop {C : context, nt : numtype, relop : relop_numtype}: - `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) + ;; 6-typing.watsup:847.1-848.62 + rule any.convert_extern {C : context, nul : nul}: + `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) - ;; 6-typing.watsup:696.1-698.23 - rule extend {C : context, n : n, nt : numtype, o0 : nat}: - `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if (n <= o0) + ;; 6-typing.watsup:844.1-845.62 + rule extern.convert_any {C : context, nul : nul}: + `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) - ;; 6-typing.watsup:700.1-703.34 - rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype, o0 : nat, o1 : nat}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) - -- if ($size($valtype_numtype(nt_1)) = ?(o0)) - -- if ($size($valtype_numtype(nt_2)) = ?(o1)) - -- if (nt_1 =/= nt_2) - -- if (o0 = o1) + ;; 6-typing.watsup:835.1-839.23 + rule array.init_data {C : context, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) + -- if (x < |C.TYPE_context|) + -- if (y < |C.DATA_context|) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:705.1-708.50 - rule convert-i {C : context, inn_1 : inn, inn_2 : inn, sx? : sx?, o0 : nat, o1 : nat}: - `%|-%:%`(C, CVTOP_instr($numtype_inn(inn_1), CONVERT_cvtop, $numtype_inn(inn_2), sx?{sx}), `%->%`([$valtype_inn(inn_2)], [$valtype_inn(inn_1)])) - -- if ($size($valtype_inn(inn_1)) = ?(o0)) - -- if ($size($valtype_inn(inn_2)) = ?(o1)) - -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> (o0 > o1)) + ;; 6-typing.watsup:830.1-833.43 + rule array.init_elem {C : context, x : idx, y : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) + -- if (x < |C.TYPE_context|) + -- if (y < |C.ELEM_context|) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- Storagetype_sub: `%|-%<:%`(C, $storagetype_elemtype(C.ELEM_context[y]), zt) - ;; 6-typing.watsup:710.1-712.24 - rule convert-f {C : context, fnn_1 : fnn, fnn_2 : fnn}: - `%|-%:%`(C, CVTOP_instr($numtype_fnn(fnn_1), CONVERT_cvtop, $numtype_fnn(fnn_2), ?()), `%->%`([$valtype_fnn(fnn_2)], [$valtype_fnn(fnn_1)])) - -- if (fnn_1 =/= fnn_2) + ;; 6-typing.watsup:824.1-828.40 + rule array.copy {C : context, mut : mut, x_1 : idx, x_2 : idx, zt_1 : storagetype, zt_2 : storagetype}: + `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_1))) I32_valtype REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_2))) I32_valtype I32_valtype], [])) + -- if (x_1 < |C.TYPE_context|) + -- if (x_2 < |C.TYPE_context|) + -- Expand: `%~~%`(C.TYPE_context[x_1], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) + -- Expand: `%~~%`(C.TYPE_context[x_2], ARRAY_comptype(`%%`(mut, zt_2))) + -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) - ;; 6-typing.watsup:717.1-719.31 - rule ref.null {C : context, ht : heaptype}: - `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:820.1-822.41 + rule array.fill {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt) I32_valtype], [])) + -- if (x < |C.TYPE_context|) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:722.1-724.23 - rule ref.func {C : context, dt : deftype, epsilon : resulttype, x : idx}: - `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), $heaptype_deftype(dt))])) - -- if (x < |C.FUNC_context|) - -- if (C.FUNC_context[x] = dt) + ;; 6-typing.watsup:816.1-818.41 + rule array.len {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) + -- if (x < |C.TYPE_context|) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:726.1-727.34 - rule ref.i31 {C : context}: - `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) + ;; 6-typing.watsup:812.1-814.41 + rule array.set {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt)], [])) + -- if (x < |C.TYPE_context|) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:729.1-730.31 - rule ref.is_null {C : context, rt : reftype}: - `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) + ;; 6-typing.watsup:807.1-810.43 + rule array.get {C : context, mut : mut, sx? : sx?, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype], [$unpacktype(zt)])) + -- if (x < |C.TYPE_context|) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) - ;; 6-typing.watsup:732.1-734.31 - rule ref.as_non_null {C : context, ht : heaptype}: - `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:801.1-805.23 + rule array.new_data {C : context, mut : mut, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx}: + `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- if (x < |C.TYPE_context|) + -- if (y < |C.DATA_context|) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_valtype(t)))) + -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:736.1-737.51 - rule ref.eq {C : context}: - `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) + ;; 6-typing.watsup:796.1-799.39 + rule array.new_elem {C : context, mut : mut, rt : reftype, x : idx, y : idx}: + `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- if (x < |C.TYPE_context|) + -- if (y < |C.ELEM_context|) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_reftype(rt)))) + -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y], rt) - ;; 6-typing.watsup:739.1-743.33 - rule ref.test {C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([$valtype_reftype(rt')], [I32_valtype])) - -- Reftype_ok: `%|-%:OK`(C, rt) - -- Reftype_ok: `%|-%:OK`(C, rt') - -- Reftype_sub: `%|-%<:%`(C, rt, rt') + ;; 6-typing.watsup:792.1-794.41 + rule array.new_fixed {C : context, mut : mut, n : n, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpacktype(zt)], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + -- if (x < |C.TYPE_context|) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - ;; 6-typing.watsup:745.1-749.33 - rule ref.cast {C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([$valtype_reftype(rt')], [$valtype_reftype(rt)])) - -- Reftype_ok: `%|-%:OK`(C, rt) - -- Reftype_ok: `%|-%:OK`(C, rt') - -- Reftype_sub: `%|-%<:%`(C, rt, rt') - - ;; 6-typing.watsup:754.1-755.42 - rule i31.get {C : context, sx : sx}: - `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) - - ;; 6-typing.watsup:760.1-762.43 - rule struct.new {C : context, mut* : mut*, x : idx, zt* : storagetype*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- if (x < |C.TYPE_context|) - -- if (|mut*{mut}| = |zt*{zt}|) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - - ;; 6-typing.watsup:764.1-767.43 - rule struct.new_default {C : context, mut* : mut*, val* : val*, x : idx, zt* : storagetype*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + ;; 6-typing.watsup:787.1-790.40 + rule array.new_default {C : context, mut : mut, val : val, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) -- if (x < |C.TYPE_context|) - -- if (|mut*{mut}| = |zt*{zt}|) - -- if (|val*{val}| = |zt*{zt}|) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- if ($default($unpacktype(zt)) = ?(val)) - ;; 6-typing.watsup:769.1-773.43 - rule struct.get {C : context, i : nat, mut : mut, sx? : sx?, x : idx, yt* : fieldtype*, zt : storagetype}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx}, x, i), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], [$unpacktype(zt)])) + ;; 6-typing.watsup:783.1-785.41 + rule array.new {C : context, mut : mut, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpacktype(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) -- if (x < |C.TYPE_context|) - -- if (i < |yt*{yt}|) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(mut, zt)) - -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) ;; 6-typing.watsup:775.1-778.24 rule struct.set {C : context, i : nat, x : idx, yt* : fieldtype*, zt : storagetype}: @@ -23283,244 +23392,279 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) - ;; 6-typing.watsup:783.1-785.41 - rule array.new {C : context, mut : mut, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpacktype(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + ;; 6-typing.watsup:769.1-773.43 + rule struct.get {C : context, i : nat, mut : mut, sx? : sx?, x : idx, yt* : fieldtype*, zt : storagetype}: + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx}, x, i), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], [$unpacktype(zt)])) -- if (x < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- if (i < |yt*{yt}|) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) + -- if (yt*{yt}[i] = `%%`(mut, zt)) + -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) - ;; 6-typing.watsup:787.1-790.40 - rule array.new_default {C : context, mut : mut, val : val, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + ;; 6-typing.watsup:764.1-767.43 + rule struct.new_default {C : context, mut* : mut*, val* : val*, x : idx, zt* : storagetype*}: + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) -- if (x < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - -- if ($default($unpacktype(zt)) = ?(val)) + -- if (|mut*{mut}| = |zt*{zt}|) + -- if (|val*{val}| = |zt*{zt}|) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} - ;; 6-typing.watsup:792.1-794.41 - rule array.new_fixed {C : context, mut : mut, n : n, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpacktype(zt)], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + ;; 6-typing.watsup:760.1-762.43 + rule struct.new {C : context, mut* : mut*, x : idx, zt* : storagetype*}: + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) -- if (x < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- if (|mut*{mut}| = |zt*{zt}|) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - ;; 6-typing.watsup:796.1-799.39 - rule array.new_elem {C : context, mut : mut, rt : reftype, x : idx, y : idx}: - `%|-%:%`(C, ARRAY.NEW_ELEM_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- if (x < |C.TYPE_context|) - -- if (y < |C.ELEM_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_reftype(rt)))) - -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y], rt) + ;; 6-typing.watsup:754.1-755.42 + rule i31.get {C : context, sx : sx}: + `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) - ;; 6-typing.watsup:801.1-805.23 - rule array.new_data {C : context, mut : mut, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx}: - `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) - -- if (x < |C.TYPE_context|) - -- if (y < |C.DATA_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_valtype(t)))) - -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:745.1-749.33 + rule ref.cast {C : context, rt : reftype, rt' : reftype}: + `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([$valtype_reftype(rt')], [$valtype_reftype(rt)])) + -- Reftype_ok: `%|-%:OK`(C, rt) + -- Reftype_ok: `%|-%:OK`(C, rt') + -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:807.1-810.43 - rule array.get {C : context, mut : mut, sx? : sx?, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype], [$unpacktype(zt)])) - -- if (x < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) + ;; 6-typing.watsup:739.1-743.33 + rule ref.test {C : context, rt : reftype, rt' : reftype}: + `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([$valtype_reftype(rt')], [I32_valtype])) + -- Reftype_ok: `%|-%:OK`(C, rt) + -- Reftype_ok: `%|-%:OK`(C, rt') + -- Reftype_sub: `%|-%<:%`(C, rt, rt') - ;; 6-typing.watsup:812.1-814.41 - rule array.set {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt)], [])) - -- if (x < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:736.1-737.51 + rule ref.eq {C : context}: + `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) - ;; 6-typing.watsup:816.1-818.41 - rule array.len {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) - -- if (x < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:732.1-734.31 + rule ref.as_non_null {C : context, ht : heaptype}: + `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:820.1-822.41 - rule array.fill {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt) I32_valtype], [])) - -- if (x < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + ;; 6-typing.watsup:729.1-730.31 + rule ref.is_null {C : context, rt : reftype}: + `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) - ;; 6-typing.watsup:824.1-828.40 - rule array.copy {C : context, mut : mut, x_1 : idx, x_2 : idx, zt_1 : storagetype, zt_2 : storagetype}: - `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_1))) I32_valtype REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_2))) I32_valtype I32_valtype], [])) - -- if (x_1 < |C.TYPE_context|) - -- if (x_2 < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x_1], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) - -- Expand: `%~~%`(C.TYPE_context[x_2], ARRAY_comptype(`%%`(mut, zt_2))) - -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) + ;; 6-typing.watsup:726.1-727.34 + rule ref.i31 {C : context}: + `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) - ;; 6-typing.watsup:830.1-833.43 - rule array.init_elem {C : context, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) - -- if (x < |C.TYPE_context|) - -- if (y < |C.ELEM_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- Storagetype_sub: `%|-%<:%`(C, $storagetype_elemtype(C.ELEM_context[y]), zt) + ;; 6-typing.watsup:722.1-724.23 + rule ref.func {C : context, dt : deftype, epsilon : resulttype, x : idx}: + `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), $heaptype_deftype(dt))])) + -- if (x < |C.FUNC_context|) + -- if (C.FUNC_context[x] = dt) - ;; 6-typing.watsup:835.1-839.23 - rule array.init_data {C : context, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) - -- if (x < |C.TYPE_context|) - -- if (y < |C.DATA_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:717.1-719.31 + rule ref.null {C : context, ht : heaptype}: + `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:844.1-845.62 - rule extern.convert_any {C : context, nul : nul}: - `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) + ;; 6-typing.watsup:710.1-712.24 + rule convert-f {C : context, fnn_1 : fnn, fnn_2 : fnn}: + `%|-%:%`(C, CVTOP_instr($numtype_fnn(fnn_1), CONVERT_cvtop, $numtype_fnn(fnn_2), ?()), `%->%`([$valtype_fnn(fnn_2)], [$valtype_fnn(fnn_1)])) + -- if (fnn_1 =/= fnn_2) - ;; 6-typing.watsup:847.1-848.62 - rule any.convert_extern {C : context, nul : nul}: - `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) + ;; 6-typing.watsup:705.1-708.50 + rule convert-i {C : context, inn_1 : inn, inn_2 : inn, sx? : sx?, o0 : nat, o1 : nat}: + `%|-%:%`(C, CVTOP_instr($numtype_inn(inn_1), CONVERT_cvtop, $numtype_inn(inn_2), sx?{sx}), `%->%`([$valtype_inn(inn_2)], [$valtype_inn(inn_1)])) + -- if ($size($valtype_inn(inn_1)) = ?(o0)) + -- if ($size($valtype_inn(inn_2)) = ?(o1)) + -- if (inn_1 =/= inn_2) + -- if ((sx?{sx} = ?()) <=> (o0 > o1)) - ;; 6-typing.watsup:853.1-855.28 - rule local.get {C : context, init : init, t : valtype, x : idx}: - `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) - -- if (x < |C.LOCAL_context|) - -- if (C.LOCAL_context[x] = `%%`(init, t)) + ;; 6-typing.watsup:700.1-703.34 + rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype, o0 : nat, o1 : nat}: + `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) + -- if ($size($valtype_numtype(nt_1)) = ?(o0)) + -- if ($size($valtype_numtype(nt_2)) = ?(o1)) + -- if (nt_1 =/= nt_2) + -- if (o0 = o1) - ;; 6-typing.watsup:868.1-870.28 - rule global.get {C : context, mut : mut, t : valtype, x : idx}: - `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) - -- if (x < |C.GLOBAL_context|) - -- if (C.GLOBAL_context[x] = `%%`(mut, t)) + ;; 6-typing.watsup:696.1-698.23 + rule extend {C : context, n : n, nt : numtype, o0 : nat}: + `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if (n <= o0) - ;; 6-typing.watsup:872.1-874.28 - rule global.set {C : context, t : valtype, x : idx}: - `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) - -- if (x < |C.GLOBAL_context|) - -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?(())), t)) + ;; 6-typing.watsup:692.1-693.37 + rule relop {C : context, nt : numtype, relop : relop_numtype}: + `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) - ;; 6-typing.watsup:879.1-881.28 - rule table.get {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) - -- if (x < |C.TABLE_context|) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:689.1-690.36 + rule testop {C : context, nt : numtype, testop : testop_numtype}: + `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) - ;; 6-typing.watsup:883.1-885.28 - rule table.set {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) - -- if (x < |C.TABLE_context|) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:686.1-687.36 + rule binop {C : context, binop : binop_numtype, nt : numtype}: + `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:887.1-889.24 - rule table.size {C : context, tt : tabletype, x : idx}: - `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) - -- if (x < |C.TABLE_context|) - -- if (C.TABLE_context[x] = tt) + ;; 6-typing.watsup:683.1-684.31 + rule unop {C : context, nt : numtype, unop : unop_numtype}: + `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:891.1-893.28 - rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) - -- if (x < |C.TABLE_context|) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:680.1-681.33 + rule const {C : context, c_nt : c, nt : numtype}: + `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:895.1-897.28 - rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) + ;; 6-typing.watsup:669.1-675.40 + rule return_call_indirect {C : context, lim : limits, rt : reftype, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx, y : idx}: + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) -- if (x < |C.TABLE_context|) + -- if (y < |C.TYPE_context|) -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) + -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:899.1-903.36 - rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt_1 : reftype, rt_2 : reftype, x_1 : idx, x_2 : idx}: - `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (x_1 < |C.TABLE_context|) - -- if (x_2 < |C.TABLE_context|) - -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt_1)) - -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt_2)) - -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + ;; 6-typing.watsup:663.1-667.40 + rule return_call_ref {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_4*{t_4})) + -- if (x < |C.TYPE_context|) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:905.1-909.36 - rule table.init {C : context, lim : limits, rt_1 : reftype, rt_2 : reftype, x : idx, y : idx}: - `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + ;; 6-typing.watsup:657.1-661.40 + rule return_call {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) + -- if (x < |C.FUNC_context|) + -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) + + ;; 6-typing.watsup:651.1-655.46 + rule call_indirect {C : context, lim : limits, rt : reftype, t_1* : valtype*, t_2* : valtype*, x : idx, y : idx}: + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) -- if (x < |C.TABLE_context|) - -- if (y < |C.ELEM_context|) - -- if (C.TABLE_context[x] = `%%`(lim, rt_1)) - -- if (C.ELEM_context[y] = rt_2) + -- if (y < |C.TYPE_context|) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) + -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + + ;; 6-typing.watsup:647.1-649.46 + rule call_ref {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_2*{t_2})) + -- if (x < |C.TYPE_context|) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + + ;; 6-typing.watsup:643.1-645.46 + rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: + `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- if (x < |C.FUNC_context|) + -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + + ;; 6-typing.watsup:639.1-641.24 + rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- if (C.RETURN_context = ?(t*{t})) + + ;; 6-typing.watsup:628.1-634.49 + rule br_on_cast_fail {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype(rt_2)])) + -- if (l < |C.LABEL_context|) + -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) + -- Reftype_ok: `%|-%:OK`(C, rt_1) + -- Reftype_ok: `%|-%:OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) - ;; 6-typing.watsup:911.1-913.23 - rule elem.drop {C : context, rt : reftype, x : idx}: - `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) - -- if (x < |C.ELEM_context|) - -- if (C.ELEM_context[x] = rt) + ;; 6-typing.watsup:620.1-626.34 + rule br_on_cast {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype($diffrt(rt_1, rt_2))])) + -- if (l < |C.LABEL_context|) + -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) + -- Reftype_ok: `%|-%:OK`(C, rt_1) + -- Reftype_ok: `%|-%:OK`(C, rt_2) + -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) - ;; 6-typing.watsup:918.1-920.22 - rule memory.size {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) - -- if (x < |C.MEM_context|) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:615.1-618.31 + rule br_on_non_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) + -- if (l < |C.LABEL_context|) + -- if (C.LABEL_context[l] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:922.1-924.22 - rule memory.grow {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) - -- if (x < |C.MEM_context|) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:610.1-613.31 + rule br_on_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) + -- if (l < |C.LABEL_context|) + -- if (C.LABEL_context[l] = t*{t}) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:926.1-928.22 - rule memory.fill {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (x < |C.MEM_context|) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:605.1-608.44 + rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- (if (l < |C.LABEL_context|))*{l} + -- if (l' < |C.LABEL_context|) + -- (Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l]))*{l} + -- Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l']) - ;; 6-typing.watsup:930.1-933.26 - rule memory.copy {C : context, mt_1 : memtype, mt_2 : memtype, x_1 : idx, x_2 : idx}: - `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (x_1 < |C.MEM_context|) - -- if (x_2 < |C.MEM_context|) - -- if (C.MEM_context[x_1] = mt_1) - -- if (C.MEM_context[x_2] = mt_2) + ;; 6-typing.watsup:601.1-603.24 + rule br_if {C : context, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) + -- if (l < |C.LABEL_context|) + -- if (C.LABEL_context[l] = t*{t}) - ;; 6-typing.watsup:935.1-938.23 - rule memory.init {C : context, mt : memtype, x : idx, y : idx}: - `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (x < |C.MEM_context|) - -- if (y < |C.DATA_context|) - -- if (C.MEM_context[x] = mt) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:597.1-599.24 + rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- if (l < |C.LABEL_context|) + -- if (C.LABEL_context[l] = t*{t}) - ;; 6-typing.watsup:940.1-942.23 - rule data.drop {C : context, x : idx}: - `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) - -- if (x < |C.DATA_context|) - -- if (C.DATA_context[x] = OK) + ;; 6-typing.watsup:588.1-592.65 + rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) - ;; 6-typing.watsup:944.1-949.29 - rule load {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, x : idx, o0 : nat, o1? : nat?}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [$valtype_numtype(nt)])) - -- if (x < |C.MEM_context|) - -- if ((n?{n} = ?()) <=> (o1?{o1} = ?())) - -- if ((n?{n} = ?()) <=> (sx?{sx} = ?())) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- (if ($size($valtype_numtype(nt)) = ?(o1)))?{o1} - -- if (C.MEM_context[x] = mt) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} - -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) + ;; 6-typing.watsup:583.1-586.61 + rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - ;; 6-typing.watsup:951.1-956.29 - rule store {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, x : idx, o0 : nat, o1? : nat?}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype $valtype_numtype(nt)], [])) - -- if (x < |C.MEM_context|) - -- if ((n?{n} = ?()) <=> (o1?{o1} = ?())) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- (if ($size($valtype_numtype(nt)) = ?(o1)))?{o1} - -- if (C.MEM_context[x] = mt) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} - -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) + ;; 6-typing.watsup:578.1-581.61 + rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + + ;; 6-typing.watsup:557.1-560.37 + rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: + `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) + -- Valtype_sub: `%|-%<:%`(C, t, t') + -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) + + ;; 6-typing.watsup:554.1-555.31 + rule select-expl {C : context, t : valtype}: + `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) + + ;; 6-typing.watsup:550.1-551.23 + rule drop {C : context, t : valtype}: + `%|-%:%`(C, DROP_instr, `%->%`([t], [])) + + ;; 6-typing.watsup:547.1-548.24 + rule nop {C : context}: + `%|-%:%`(C, NOP_instr, `%->%`([], [])) + + ;; 6-typing.watsup:544.1-545.34 + rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) ;; 6-typing.watsup:504.1-504.67 relation Instrf_ok: `%|-%:%`(context, instr, instrtype) - ;; 6-typing.watsup:518.1-520.41 - rule instr {C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + ;; 6-typing.watsup:861.1-863.28 + rule local.tee {C : context, init : init, t : valtype, x : idx}: + `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) + -- if (x < |C.LOCAL_context|) + -- if (C.LOCAL_context[x] = `%%`(init, t)) ;; 6-typing.watsup:857.1-859.28 rule local.set {C : context, init : init, t : valtype, x : idx}: @@ -23528,17 +23672,23 @@ relation Instrf_ok: `%|-%:%`(context, instr, instrtype) -- if (x < |C.LOCAL_context|) -- if (C.LOCAL_context[x] = `%%`(init, t)) - ;; 6-typing.watsup:861.1-863.28 - rule local.tee {C : context, init : init, t : valtype, x : idx}: - `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) - -- if (x < |C.LOCAL_context|) - -- if (C.LOCAL_context[x] = `%%`(init, t)) + ;; 6-typing.watsup:518.1-520.41 + rule instr {C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) ;; 6-typing.watsup:505.1-505.74 relation Instrs_ok: `%|-%*:%`(context, instr*, instrtype) - ;; 6-typing.watsup:522.1-523.29 - rule empty {C : context}: - `%|-%*:%`(C, [], `%->%*%`([], [], [])) + ;; 6-typing.watsup:537.1-539.47 + rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%*:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + + ;; 6-typing.watsup:532.1-535.35 + rule sub {C : context, instr* : instr*, it : instrtype, it' : instrtype}: + `%|-%*:%`(C, instr*{instr}, it') + -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, it) + -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:525.1-530.52 rule seq {C : context, C' : context, init* : init*, instr_1 : instr, instr_2* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, x_1* : idx*, x_2* : idx*}: @@ -23551,16 +23701,9 @@ relation Instrs_ok: `%|-%*:%`(context, instr*, instrtype) -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) -- Instrs_ok: `%|-%*:%`(C', instr_2*{instr_2}, `%->%*%`(t_2*{t_2}, x_2*{x_2}, t_3*{t_3})) - ;; 6-typing.watsup:532.1-535.35 - rule sub {C : context, instr* : instr*, it : instrtype, it' : instrtype}: - `%|-%*:%`(C, instr*{instr}, it') - -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, it) - -- Instrtype_sub: `%|-%<:%`(C, it, it') - - ;; 6-typing.watsup:537.1-539.47 - rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%*:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:522.1-523.29 + rule empty {C : context}: + `%|-%*:%`(C, [], `%->%*%`([], [], [])) } ;; 6-typing.watsup:506.1-506.72 @@ -23575,10 +23718,10 @@ rec { ;; 6-typing.watsup:985.1-985.64 def in_binop : (binop_numtype, ibinop*) -> bool - ;; 6-typing.watsup:986.1-986.38 - def {binop : binop_numtype, epsilon : ibinop*} in_binop(binop, epsilon) = false ;; 6-typing.watsup:987.1-987.92 def {binop : binop_numtype, ibinop'* : ibinop*, ibinop_1 : ibinop} in_binop(binop, [ibinop_1] :: ibinop'*{ibinop'}) = ((binop = _I_binop_numtype(ibinop_1)) \/ $in_binop(binop, ibinop'*{ibinop'})) + ;; 6-typing.watsup:986.1-986.38 + def {binop : binop_numtype, epsilon : ibinop*} in_binop(binop, epsilon) = false } ;; 6-typing.watsup:981.1-981.63 @@ -23586,25 +23729,19 @@ rec { ;; 6-typing.watsup:981.1-981.63 def in_numtype : (numtype, numtype*) -> bool - ;; 6-typing.watsup:982.1-982.37 - def {epsilon : numtype*, nt : numtype} in_numtype(nt, epsilon) = false ;; 6-typing.watsup:983.1-983.68 def {nt : numtype, nt'* : numtype*, nt_1 : numtype} in_numtype(nt, [nt_1] :: nt'*{nt'}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt'})) + ;; 6-typing.watsup:982.1-982.37 + def {epsilon : numtype*, nt : numtype} in_numtype(nt, epsilon) = false } ;; 6-typing.watsup:963.1-963.78 relation Instr_const: `%|-%CONST`(context, instr) - ;; 6-typing.watsup:967.1-968.26 - rule const {C : context, c : c, nt : numtype}: - `%|-%CONST`(C, CONST_instr(nt, c)) - - ;; 6-typing.watsup:970.1-971.27 - rule ref.null {C : context, ht : heaptype}: - `%|-%CONST`(C, REF.NULL_instr(ht)) - - ;; 6-typing.watsup:973.1-974.26 - rule ref.func {C : context, x : idx}: - `%|-%CONST`(C, REF.FUNC_instr(x)) + ;; 6-typing.watsup:989.1-992.38 + rule binop {C : context, binop : binop_numtype, nt : numtype}: + `%|-%CONST`(C, BINOP_instr(nt, binop)) + -- if $in_numtype(nt, [I32_numtype I64_numtype]) + -- if $in_binop(binop, [ADD_ibinop SUB_ibinop MUL_ibinop]) ;; 6-typing.watsup:976.1-978.24 rule global.get {C : context, t : valtype, x : idx}: @@ -23612,11 +23749,17 @@ relation Instr_const: `%|-%CONST`(context, instr) -- if (x < |C.GLOBAL_context|) -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?()), t)) - ;; 6-typing.watsup:989.1-992.38 - rule binop {C : context, binop : binop_numtype, nt : numtype}: - `%|-%CONST`(C, BINOP_instr(nt, binop)) - -- if $in_numtype(nt, [I32_numtype I64_numtype]) - -- if $in_binop(binop, [ADD_ibinop SUB_ibinop MUL_ibinop]) + ;; 6-typing.watsup:973.1-974.26 + rule ref.func {C : context, x : idx}: + `%|-%CONST`(C, REF.FUNC_instr(x)) + + ;; 6-typing.watsup:970.1-971.27 + rule ref.null {C : context, ht : heaptype}: + `%|-%CONST`(C, REF.NULL_instr(ht)) + + ;; 6-typing.watsup:967.1-968.26 + rule const {C : context, c : c, nt : numtype}: + `%|-%CONST`(C, CONST_instr(nt, c)) ;; 6-typing.watsup:964.1-964.77 relation Expr_const: `%|-%CONST`(context, expr) @@ -23644,16 +23787,16 @@ relation Type_ok: `%|-%:%*`(context, type, deftype*) ;; 6-typing.watsup:1013.1-1013.74 relation Local_ok: `%|-%:%`(context, local, localtype) - ;; 6-typing.watsup:1029.1-1031.28 - rule set {C : context, t : valtype}: - `%|-%:%`(C, LOCAL(t), `%%`(SET_init, t)) - -- if ($default(t) =/= ?()) - ;; 6-typing.watsup:1033.1-1035.26 rule unset {C : context, t : valtype}: `%|-%:%`(C, LOCAL(t), `%%`(UNSET_init, t)) -- if ($default(t) = ?()) + ;; 6-typing.watsup:1029.1-1031.28 + rule set {C : context, t : valtype}: + `%|-%:%`(C, LOCAL(t), `%%`(SET_init, t)) + -- if ($default(t) =/= ?()) + ;; 6-typing.watsup:1012.1-1012.73 relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup:1037.1-1041.82 @@ -23692,6 +23835,14 @@ relation Mem_ok: `%|-%:%`(context, mem, memtype) ;; 6-typing.watsup:1019.1-1019.77 relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) + ;; 6-typing.watsup:1076.1-1077.20 + rule declare {C : context, rt : reftype}: + `%|-%:%`(C, DECLARE_elemmode, rt) + + ;; 6-typing.watsup:1073.1-1074.20 + rule passive {C : context, rt : reftype}: + `%|-%:%`(C, PASSIVE_elemmode, rt) + ;; 6-typing.watsup:1068.1-1071.45 rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) @@ -23699,14 +23850,6 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) -- if (C.TABLE_context[x] = `%%`(lim, rt)) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 6-typing.watsup:1073.1-1074.20 - rule passive {C : context, rt : reftype}: - `%|-%:%`(C, PASSIVE_elemmode, rt) - - ;; 6-typing.watsup:1076.1-1077.20 - rule declare {C : context, rt : reftype}: - `%|-%:%`(C, DECLARE_elemmode, rt) - ;; 6-typing.watsup:1017.1-1017.73 relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup:1059.1-1062.37 @@ -23717,6 +23860,10 @@ relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup:1020.1-1020.77 relation Datamode_ok: `%|-%:OK`(context, datamode) + ;; 6-typing.watsup:1084.1-1085.20 + rule passive {C : context}: + `%|-%:OK`(C, PASSIVE_datamode) + ;; 6-typing.watsup:1079.1-1082.45 rule active {C : context, expr : expr, mt : memtype, x : idx}: `%|-%:OK`(C, ACTIVE_datamode(x, expr)) @@ -23724,10 +23871,6 @@ relation Datamode_ok: `%|-%:OK`(context, datamode) -- if (C.MEM_context[x] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 6-typing.watsup:1084.1-1085.20 - rule passive {C : context}: - `%|-%:OK`(C, PASSIVE_datamode) - ;; 6-typing.watsup:1018.1-1018.73 relation Data_ok: `%|-%:OK`(context, data) ;; 6-typing.watsup:1064.1-1066.37 @@ -23752,17 +23895,11 @@ relation Import_ok: `%|-%:%`(context, import, externtype) ;; 6-typing.watsup:1096.1-1096.83 relation Externidx_ok: `%|-%:%`(context, externidx, externtype) - ;; 6-typing.watsup:1107.1-1109.23 - rule func {C : context, dt : deftype, x : idx}: - `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) - -- if (x < |C.FUNC_context|) - -- if (C.FUNC_context[x] = dt) - - ;; 6-typing.watsup:1111.1-1113.25 - rule global {C : context, gt : globaltype, x : idx}: - `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) - -- if (x < |C.GLOBAL_context|) - -- if (C.GLOBAL_context[x] = gt) + ;; 6-typing.watsup:1119.1-1121.22 + rule mem {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) + -- if (x < |C.MEM_context|) + -- if (C.MEM_context[x] = mt) ;; 6-typing.watsup:1115.1-1117.24 rule table {C : context, tt : tabletype, x : idx}: @@ -23770,11 +23907,17 @@ relation Externidx_ok: `%|-%:%`(context, externidx, externtype) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = tt) - ;; 6-typing.watsup:1119.1-1121.22 - rule mem {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) - -- if (x < |C.MEM_context|) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:1111.1-1113.25 + rule global {C : context, gt : globaltype, x : idx}: + `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) + -- if (x < |C.GLOBAL_context|) + -- if (C.GLOBAL_context[x] = gt) + + ;; 6-typing.watsup:1107.1-1109.23 + rule func {C : context, dt : deftype, x : idx}: + `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) + -- if (x < |C.FUNC_context|) + -- if (C.FUNC_context[x] = dt) ;; 6-typing.watsup:1095.1-1095.80 relation Export_ok: `%|-%:%`(context, export, externtype) @@ -23788,15 +23931,15 @@ rec { ;; 6-typing.watsup:1128.1-1128.77 relation Globals_ok: `%|-%*:%*`(context, global*, globaltype*) - ;; 6-typing.watsup:1171.1-1172.17 - rule empty {C : context}: - `%|-%*:%*`(C, [], []) - ;; 6-typing.watsup:1174.1-1177.54 rule cons {C : context, global : global, global_1 : global, gt* : globaltype*, gt_1 : globaltype}: `%|-%*:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt}) -- Global_ok: `%|-%:%`(C, global, gt_1) -- Globals_ok: `%|-%*:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt}) + + ;; 6-typing.watsup:1171.1-1172.17 + rule empty {C : context}: + `%|-%*:%*`(C, [], []) } ;; 6-typing.watsup:1127.1-1127.75 @@ -23804,15 +23947,15 @@ rec { ;; 6-typing.watsup:1127.1-1127.75 relation Types_ok: `%|-%*:%*`(context, type*, deftype*) - ;; 6-typing.watsup:1163.1-1164.17 - rule empty {C : context}: - `%|-%*:%*`(C, [], []) - ;; 6-typing.watsup:1166.1-1169.49 rule cons {C : context, dt* : deftype*, dt_1 : deftype, type* : type*, type_1 : type}: `%|-%*:%*`(C, [type_1] :: type*{type}, dt_1*{} :: dt*{dt}) -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) -- Types_ok: `%|-%*:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, dt*{dt}) + + ;; 6-typing.watsup:1163.1-1164.17 + rule empty {C : context}: + `%|-%*:%*`(C, [], []) } ;; 6-typing.watsup:1126.1-1126.76 @@ -23845,19 +23988,19 @@ relation Module_ok: `|-%:OK`(module) ;; 7-runtime-typing.watsup:5.1-5.40 relation Ref_ok: `%|-%:%`(store, ref, reftype) - ;; 7-runtime-typing.watsup:7.1-8.35 - rule null {ht : heaptype, s : store}: - `%|-%:%`(s, REF.NULL_ref(ht), REF_reftype(`NULL%?`(?(())), ht)) + ;; 7-runtime-typing.watsup:28.1-29.45 + rule extern {addrref : addrref, s : store}: + `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) - ;; 7-runtime-typing.watsup:10.1-11.37 - rule i31 {i : nat, s : store}: - `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) + ;; 7-runtime-typing.watsup:25.1-26.39 + rule host {a : addr, s : store}: + `%|-%:%`(s, REF.HOST_ADDR_ref(a), REF_reftype(`NULL%?`(?()), ANY_heaptype)) - ;; 7-runtime-typing.watsup:13.1-15.30 - rule struct {a : addr, dt : deftype, s : store}: - `%|-%:%`(s, REF.STRUCT_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) - -- if (a < |s.STRUCT_store|) - -- if (s.STRUCT_store[a].TYPE_structinst = dt) + ;; 7-runtime-typing.watsup:21.1-23.28 + rule func {a : addr, dt : deftype, s : store}: + `%|-%:%`(s, REF.FUNC_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) + -- if (a < |s.FUNC_store|) + -- if (s.FUNC_store[a].TYPE_funcinst = dt) ;; 7-runtime-typing.watsup:17.1-19.29 rule array {a : addr, dt : deftype, s : store}: @@ -23865,458 +24008,497 @@ relation Ref_ok: `%|-%:%`(store, ref, reftype) -- if (a < |s.ARRAY_store|) -- if (s.ARRAY_store[a].TYPE_arrayinst = dt) - ;; 7-runtime-typing.watsup:21.1-23.28 - rule func {a : addr, dt : deftype, s : store}: - `%|-%:%`(s, REF.FUNC_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) - -- if (a < |s.FUNC_store|) - -- if (s.FUNC_store[a].TYPE_funcinst = dt) + ;; 7-runtime-typing.watsup:13.1-15.30 + rule struct {a : addr, dt : deftype, s : store}: + `%|-%:%`(s, REF.STRUCT_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) + -- if (a < |s.STRUCT_store|) + -- if (s.STRUCT_store[a].TYPE_structinst = dt) - ;; 7-runtime-typing.watsup:25.1-26.39 - rule host {a : addr, s : store}: - `%|-%:%`(s, REF.HOST_ADDR_ref(a), REF_reftype(`NULL%?`(?()), ANY_heaptype)) + ;; 7-runtime-typing.watsup:10.1-11.37 + rule i31 {i : nat, s : store}: + `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) - ;; 7-runtime-typing.watsup:28.1-29.45 - rule extern {addrref : addrref, s : store}: - `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) + ;; 7-runtime-typing.watsup:7.1-8.35 + rule null {ht : heaptype, s : store}: + `%|-%:%`(s, REF.NULL_ref(ht), REF_reftype(`NULL%?`(?(())), ht)) ;; 8-reduction.watsup:6.1-6.63 relation Step_pure: `%*~>%*`(admininstr*, admininstr*) - ;; 8-reduction.watsup:42.1-43.24 - rule unreachable: - `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) + ;; 8-reduction.watsup:552.1-553.47 + rule local.tee {val : val, x : idx}: + `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) - ;; 8-reduction.watsup:45.1-46.15 - rule nop: - `%*~>%*`([NOP_admininstr], []) + ;; 8-reduction.watsup:539.1-540.55 + rule any.convert_extern-addr {addrref : addrref}: + `%*~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [$admininstr_addrref(addrref)]) - ;; 8-reduction.watsup:48.1-49.20 - rule drop {val : val}: - `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) + ;; 8-reduction.watsup:536.1-537.55 + rule any.convert_extern-null {ht : heaptype}: + `%*~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) - ;; 8-reduction.watsup:52.1-54.16 - rule select-true {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: - `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_1)]) - -- if (c =/= 0) + ;; 8-reduction.watsup:532.1-533.55 + rule extern.convert_any-addr {addrref : addrref}: + `%*~>%*`([$admininstr_addrref(addrref) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) - ;; 8-reduction.watsup:56.1-58.14 - rule select-false {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: - `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_2)]) - -- if (c = 0) + ;; 8-reduction.watsup:529.1-530.58 + rule extern.convert_any-null {ht : heaptype}: + `%*~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) - ;; 8-reduction.watsup:76.1-78.16 - rule if-true {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) - -- if (c =/= 0) + ;; 8-reduction.watsup:311.1-312.68 + rule i31.get-num {i : nat, sx : sx}: + `%*~>%*`([REF.I31_NUM_admininstr(i) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, i))]) - ;; 8-reduction.watsup:80.1-82.14 - rule if-false {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) - -- if (c = 0) + ;; 8-reduction.watsup:308.1-309.39 + rule i31.get-null {ht : heaptype, sx : sx}: + `%*~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) - ;; 8-reduction.watsup:85.1-86.38 - rule label-vals {instr* : instr*, n : n, val* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) + ;; 8-reduction.watsup:281.1-283.15 + rule ref.eq-false {ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 0)]) + -- otherwise - ;; 8-reduction.watsup:92.1-93.69 - rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) + ;; 8-reduction.watsup:276.1-279.22 + rule ref.eq-true {ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- otherwise + -- if (ref_1 = ref_2) - ;; 8-reduction.watsup:95.1-96.65 - rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) + ;; 8-reduction.watsup:272.1-274.55 + rule ref.eq-null {ht_1 : heaptype, ht_2 : heaptype, ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) - ;; 8-reduction.watsup:99.1-101.16 - rule br_if-true {c : c, l : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) - -- if (c =/= 0) + ;; 8-reduction.watsup:267.1-269.15 + rule ref.as_non_null-addr {ref : ref}: + `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [$admininstr_ref(ref)]) + -- otherwise - ;; 8-reduction.watsup:103.1-105.14 - rule br_if-false {c : c, l : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) - -- if (c = 0) + ;; 8-reduction.watsup:263.1-265.28 + rule ref.as_non_null-null {ht : heaptype, ref : ref}: + `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) + -- if (ref = REF.NULL_ref(ht)) - ;; 8-reduction.watsup:108.1-110.17 - rule br_table-lt {i : nat, l* : labelidx*, l' : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) - -- if (i < |l*{l}|) + ;; 8-reduction.watsup:258.1-260.15 + rule ref.is_null-false {val : val}: + `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) + -- otherwise - ;; 8-reduction.watsup:112.1-114.18 - rule br_table-ge {i : nat, l* : labelidx*, l' : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) - -- if (i >= |l*{l}|) + ;; 8-reduction.watsup:254.1-256.28 + rule ref.is_null-true {ht : heaptype, val : val}: + `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:117.1-119.26 - rule br_on_null-null {ht : heaptype, l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) - -- if (val = REF.NULL_val(ht)) + ;; 8-reduction.watsup:250.1-251.60 + rule ref.i31 {i : nat}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, i))]) - ;; 8-reduction.watsup:121.1-123.15 - rule br_on_null-addr {l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [$admininstr_val(val)]) - -- otherwise + ;; 8-reduction.watsup:240.1-242.50 + rule cvtop-trap {c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: + `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) + -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = []) - ;; 8-reduction.watsup:126.1-128.26 - rule br_on_non_null-null {ht : heaptype, l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], []) - -- if (val = REF.NULL_val(ht)) + ;; 8-reduction.watsup:236.1-238.48 + rule cvtop-val {c : c, c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: + `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) + -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = [c]) - ;; 8-reduction.watsup:130.1-132.15 - rule br_on_non_null-addr {l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], [$admininstr_val(val) BR_admininstr(l)]) - -- otherwise + ;; 8-reduction.watsup:232.1-233.70 + rule extend {c : c, n : n, nt : numtype, o0 : nat}: + `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, o0, S_sx, c))]) + -- if ($size($valtype_numtype(nt)) = ?(o0)) - ;; 8-reduction.watsup:186.1-187.84 - rule call_indirect-call {x : idx, y : idx}: - `%*~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) CALL_REF_admininstr(?(y))]) + ;; 8-reduction.watsup:227.1-229.40 + rule relop {c : c, c_1 : c, c_2 : c, nt : numtype, relop : relop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) + -- if (c = $relop(relop, nt, c_1, c_2)) - ;; 8-reduction.watsup:189.1-190.98 - rule return_call_indirect {x : idx, y : idx}: - `%*~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) RETURN_CALL_REF_admininstr(?(y))]) + ;; 8-reduction.watsup:223.1-225.37 + rule testop {c : c, c_1 : c, nt : numtype, testop : testop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) + -- if (c = $testop(testop, nt, c_1)) - ;; 8-reduction.watsup:193.1-194.35 - rule frame-vals {f : frame, n : n, val^n : val^n}: - `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) + ;; 8-reduction.watsup:218.1-220.42 + rule binop-trap {binop : binop_numtype, c_1 : c, c_2 : c, nt : numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) + -- if ($binop(binop, nt, c_1, c_2) = []) - ;; 8-reduction.watsup:196.1-197.55 - rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: - `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) + ;; 8-reduction.watsup:214.1-216.40 + rule binop-val {binop : binop_numtype, c : c, c_1 : c, c_2 : c, nt : numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) + -- if ($binop(binop, nt, c_1, c_2) = [c]) - ;; 8-reduction.watsup:199.1-200.60 - rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: - `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) + ;; 8-reduction.watsup:209.1-211.35 + rule unop-trap {c_1 : c, nt : numtype, unop : unop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) + -- if ($unop(unop, nt, c_1) = []) ;; 8-reduction.watsup:205.1-207.33 rule unop-val {c : c, c_1 : c, nt : numtype, unop : unop_numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) -- if ($unop(unop, nt, c_1) = [c]) - ;; 8-reduction.watsup:209.1-211.35 - rule unop-trap {c_1 : c, nt : numtype, unop : unop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) - -- if ($unop(unop, nt, c_1) = []) - - ;; 8-reduction.watsup:214.1-216.40 - rule binop-val {binop : binop_numtype, c : c, c_1 : c, c_2 : c, nt : numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) - -- if ($binop(binop, nt, c_1, c_2) = [c]) + ;; 8-reduction.watsup:199.1-200.60 + rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: + `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) - ;; 8-reduction.watsup:218.1-220.42 - rule binop-trap {binop : binop_numtype, c_1 : c, c_2 : c, nt : numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) - -- if ($binop(binop, nt, c_1, c_2) = []) + ;; 8-reduction.watsup:196.1-197.55 + rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: + `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) - ;; 8-reduction.watsup:223.1-225.37 - rule testop {c : c, c_1 : c, nt : numtype, testop : testop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) - -- if (c = $testop(testop, nt, c_1)) + ;; 8-reduction.watsup:193.1-194.35 + rule frame-vals {f : frame, n : n, val^n : val^n}: + `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) - ;; 8-reduction.watsup:227.1-229.40 - rule relop {c : c, c_1 : c, c_2 : c, nt : numtype, relop : relop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) - -- if (c = $relop(relop, nt, c_1, c_2)) + ;; 8-reduction.watsup:189.1-190.98 + rule return_call_indirect {x : idx, y : idx}: + `%*~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) RETURN_CALL_REF_admininstr(?(y))]) - ;; 8-reduction.watsup:232.1-233.70 - rule extend {c : c, n : n, nt : numtype, o0 : nat}: - `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, o0, S_sx, c))]) - -- if ($size($valtype_numtype(nt)) = ?(o0)) + ;; 8-reduction.watsup:186.1-187.84 + rule call_indirect-call {x : idx, y : idx}: + `%*~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) CALL_REF_admininstr(?(y))]) - ;; 8-reduction.watsup:236.1-238.48 - rule cvtop-val {c : c, c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: - `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) - -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = [c]) + ;; 8-reduction.watsup:130.1-132.15 + rule br_on_non_null-addr {l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], [$admininstr_val(val) BR_admininstr(l)]) + -- otherwise - ;; 8-reduction.watsup:240.1-242.50 - rule cvtop-trap {c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: - `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) - -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = []) + ;; 8-reduction.watsup:126.1-128.26 + rule br_on_non_null-null {ht : heaptype, l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], []) + -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:250.1-251.60 - rule ref.i31 {i : nat}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, i))]) + ;; 8-reduction.watsup:121.1-123.15 + rule br_on_null-addr {l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [$admininstr_val(val)]) + -- otherwise - ;; 8-reduction.watsup:254.1-256.28 - rule ref.is_null-true {ht : heaptype, val : val}: - `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) + ;; 8-reduction.watsup:117.1-119.26 + rule br_on_null-null {ht : heaptype, l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) -- if (val = REF.NULL_val(ht)) - ;; 8-reduction.watsup:258.1-260.15 - rule ref.is_null-false {val : val}: - `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) - -- otherwise + ;; 8-reduction.watsup:112.1-114.18 + rule br_table-ge {i : nat, l* : labelidx*, l' : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) + -- if (i >= |l*{l}|) - ;; 8-reduction.watsup:263.1-265.28 - rule ref.as_non_null-null {ht : heaptype, ref : ref}: - `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) - -- if (ref = REF.NULL_ref(ht)) + ;; 8-reduction.watsup:108.1-110.17 + rule br_table-lt {i : nat, l* : labelidx*, l' : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) + -- if (i < |l*{l}|) - ;; 8-reduction.watsup:267.1-269.15 - rule ref.as_non_null-addr {ref : ref}: - `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [$admininstr_ref(ref)]) - -- otherwise + ;; 8-reduction.watsup:103.1-105.14 + rule br_if-false {c : c, l : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) + -- if (c = 0) - ;; 8-reduction.watsup:272.1-274.55 - rule ref.eq-null {ht_1 : heaptype, ht_2 : heaptype, ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) + ;; 8-reduction.watsup:99.1-101.16 + rule br_if-true {c : c, l : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) + -- if (c =/= 0) - ;; 8-reduction.watsup:276.1-279.22 - rule ref.eq-true {ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- otherwise - -- if (ref_1 = ref_2) + ;; 8-reduction.watsup:95.1-96.65 + rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) - ;; 8-reduction.watsup:281.1-283.15 - rule ref.eq-false {ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 0)]) - -- otherwise + ;; 8-reduction.watsup:92.1-93.69 + rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) - ;; 8-reduction.watsup:308.1-309.39 - rule i31.get-null {ht : heaptype, sx : sx}: - `%*~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) + ;; 8-reduction.watsup:85.1-86.38 + rule label-vals {instr* : instr*, n : n, val* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) - ;; 8-reduction.watsup:311.1-312.68 - rule i31.get-num {i : nat, sx : sx}: - `%*~>%*`([REF.I31_NUM_admininstr(i) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, i))]) + ;; 8-reduction.watsup:80.1-82.14 + rule if-false {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) + -- if (c = 0) - ;; 8-reduction.watsup:529.1-530.58 - rule extern.convert_any-null {ht : heaptype}: - `%*~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) + ;; 8-reduction.watsup:76.1-78.16 + rule if-true {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) + -- if (c =/= 0) - ;; 8-reduction.watsup:532.1-533.55 - rule extern.convert_any-addr {addrref : addrref}: - `%*~>%*`([$admininstr_addrref(addrref) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) + ;; 8-reduction.watsup:56.1-58.14 + rule select-false {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: + `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_2)]) + -- if (c = 0) - ;; 8-reduction.watsup:536.1-537.55 - rule any.convert_extern-null {ht : heaptype}: - `%*~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) + ;; 8-reduction.watsup:52.1-54.16 + rule select-true {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: + `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_1)]) + -- if (c =/= 0) - ;; 8-reduction.watsup:539.1-540.55 - rule any.convert_extern-addr {addrref : addrref}: - `%*~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [$admininstr_addrref(addrref)]) + ;; 8-reduction.watsup:48.1-49.20 + rule drop {val : val}: + `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) - ;; 8-reduction.watsup:552.1-553.47 - rule local.tee {val : val, x : idx}: - `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) + ;; 8-reduction.watsup:45.1-46.15 + rule nop: + `%*~>%*`([NOP_admininstr], []) + + ;; 8-reduction.watsup:42.1-43.24 + rule unreachable: + `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) ;; 8-reduction.watsup:63.1-63.73 def blocktype : (state, blocktype) -> functype - ;; 8-reduction.watsup:64.1-64.44 - def {z : state} blocktype(z, _RESULT_blocktype(?())) = `%->%`([], []) - ;; 8-reduction.watsup:65.1-65.40 - def {t : valtype, z : state} blocktype(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) ;; 8-reduction.watsup:66.1-66.66 def {ft : functype, x : idx, z : state} blocktype(z, _IDX_blocktype(x)) = ft -- Expand: `%~~%`($type(z, x), FUNC_comptype(ft)) + ;; 8-reduction.watsup:65.1-65.40 + def {t : valtype, z : state} blocktype(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) + ;; 8-reduction.watsup:64.1-64.44 + def {z : state} blocktype(z, _RESULT_blocktype(?())) = `%->%`([], []) ;; 8-reduction.watsup:7.1-7.63 relation Step_read: `%~>%*`(config, admininstr*) - ;; 8-reduction.watsup:68.1-70.43 - rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + ;; 8-reduction.watsup:753.1-757.15 + rule memory.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, y).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x, y)]) + -- if (i < |$data(z, y).DATA_datainst|) + -- otherwise - ;; 8-reduction.watsup:72.1-74.43 - rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) - -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) + ;; 8-reduction.watsup:748.1-751.14 + rule memory.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:135.1-138.66 - rule br_on_cast-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt) - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) + ;; 8-reduction.watsup:744.1-746.70 + rule memory.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) - ;; 8-reduction.watsup:140.1-142.15 - rule br_on_cast-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) + ;; 8-reduction.watsup:737.1-741.15 + rule memory.copy-gt {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise - ;; 8-reduction.watsup:145.1-148.66 - rule br_on_cast_fail-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt) - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) + ;; 8-reduction.watsup:730.1-735.19 + rule memory.copy-le {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, (i_1 + 1)) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) + -- otherwise + -- if (i_1 <= i_2) - ;; 8-reduction.watsup:150.1-152.15 - rule br_on_cast_fail-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) + ;; 8-reduction.watsup:725.1-728.14 + rule memory.copy-zero {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), []) -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:157.1-158.62 - rule call {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) CALL_REF_admininstr(?())]) - -- if (x < |$funcaddr(z)|) + ;; 8-reduction.watsup:721.1-723.77 + rule memory.copy-oob {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) - ;; 8-reduction.watsup:160.1-161.43 - rule call_ref-null {ht : heaptype, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) + ;; 8-reduction.watsup:714.1-718.15 + rule memory.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr(x)]) + -- otherwise - ;; 8-reduction.watsup:163.1-168.59 - rule call_ref-func {a : addr, f : frame, fi : funcinst, instr* : instr*, m : m, n : n, t* : valtype*, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, x? : idx?, y : idx, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], $admininstr_instr(instr)*{instr})])]) - -- if (a < |$funcinst(z)|) - -- if ($funcinst(z)[a] = fi) - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) - -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) + ;; 8-reduction.watsup:709.1-712.14 + rule memory.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:171.1-172.76 - rule return_call {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) RETURN_CALL_REF_admininstr(?())]) - -- if (x < |$funcaddr(z)|) + ;; 8-reduction.watsup:705.1-707.37 + rule memory.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:175.1-176.78 - rule return_call_ref-frame-null {f : frame, ht : heaptype, instr* : instr*, k : nat, val* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), [TRAP_admininstr]) + ;; 8-reduction.watsup:692.1-694.44 + rule memory.size {n : n, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) + -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:178.1-180.59 - rule return_call_ref-frame-addr {a : addr, f : frame, instr* : instr*, k : nat, m : m, n : n, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, val'* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) - -- if (a < |$funcinst(z)|) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + ;; 8-reduction.watsup:670.1-672.61 + rule load-pack-val {c : c, i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state, o0 : nat}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [CONST_admininstr(nt, $ext(n, o0, sx, c))]) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) - ;; 8-reduction.watsup:182.1-183.91 - rule return_call_ref-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) + ;; 8-reduction.watsup:666.1-668.51 + rule load-pack-oob {i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [TRAP_admininstr]) + -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:247.1-248.55 - rule ref.func {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) - -- if (x < |$funcaddr(z)|) + ;; 8-reduction.watsup:662.1-664.71 + rule load-num-val {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (o0 / 8)]) - ;; 8-reduction.watsup:286.1-289.65 - rule ref.test-true {ref : ref, rt : reftype, rt' : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 1)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt') - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) + ;; 8-reduction.watsup:658.1-660.59 + rule load-num-oob {i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if (((i + mo.OFFSET_memop) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:291.1-293.15 - rule ref.test-false {ref : ref, rt : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 0)]) + ;; 8-reduction.watsup:645.1-649.15 + rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.INIT_admininstr(x, y)]) + -- if (i < |$elem(z, y).ELEM_eleminst|) -- otherwise - ;; 8-reduction.watsup:296.1-299.65 - rule ref.cast-succeed {ref : ref, rt : reftype, rt' : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [$admininstr_ref(ref)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt') - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) + ;; 8-reduction.watsup:640.1-643.14 + rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:301.1-303.15 - rule ref.cast-fail {ref : ref, rt : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:636.1-638.72 + rule table.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) + + ;; 8-reduction.watsup:629.1-633.15 + rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) -- otherwise - ;; 8-reduction.watsup:322.1-325.43 - rule struct.new_default {mut* : mut*, val* : val*, x : idx, z : state, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)*{val} :: [STRUCT.NEW_admininstr(x)]) - -- if (|mut*{mut}| = |zt*{zt}|) - -- if (|val*{val}| = |zt*{zt}|) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} + ;; 8-reduction.watsup:622.1-627.15 + rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) + -- otherwise + -- if (j <= i) - ;; 8-reduction.watsup:328.1-329.50 - rule struct.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:617.1-620.14 + rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:331.1-334.41 - rule struct.get-struct {a : addr, i : nat, mut* : mut*, si : structinst, sx? : sx?, x : idx, z : state, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [$admininstr_val($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]))]) - -- if (a < |$structinst(z)|) - -- if (|mut*{mut}| = |zt*{zt}|) - -- if (i < |zt*{zt}|) - -- if (i < |si.FIELD_structinst|) - -- if ($structinst(z)[a] = si) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + ;; 8-reduction.watsup:613.1-615.73 + rule table.copy-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) - ;; 8-reduction.watsup:348.1-349.70 - rule array.new {n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.NEW_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + ;; 8-reduction.watsup:606.1-610.15 + rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) + -- otherwise - ;; 8-reduction.watsup:351.1-354.40 - rule array.new_default {mut : mut, n : n, val : val, x : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) ARRAY.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ($default($unpacktype(zt)) = ?(val)) + ;; 8-reduction.watsup:601.1-604.14 + rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:362.1-364.38 - rule array.new_elem-oob {i : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) + ;; 8-reduction.watsup:597.1-599.39 + rule table.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:366.1-368.40 - rule array.new_elem-alloc {i : nat, n : n, ref^n : ref^n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), $admininstr_ref(ref)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) + ;; 8-reduction.watsup:584.1-586.32 + rule table.size {n : n, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) + -- if (|$table(z, x).ELEM_tableinst| = n) - ;; 8-reduction.watsup:371.1-374.59 - rule array.new_data-oob {i : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) + ;; 8-reduction.watsup:571.1-573.32 + rule table.get-val {i : nat, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) + -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:376.1-380.88 - rule array.new_data-alloc {c^n : c^n, i : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + ;; 8-reduction.watsup:567.1-569.33 + rule table.get-oob {i : nat, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) + -- if (i >= |$table(z, x).ELEM_tableinst|) + + ;; 8-reduction.watsup:558.1-559.45 + rule global.get {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) + + ;; 8-reduction.watsup:545.1-547.27 + rule local.get {val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val(val)]) + -- if ($local(z, x) = ?(val)) + + ;; 8-reduction.watsup:517.1-524.67 + rule array.init_data-succ {a : addr, c : c, i : nat, j : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + ($storagesize(zt) / 8))) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_DATA_admininstr(x, y)]) + -- otherwise -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (nt = $unpacknumtype(zt)) - -- if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) + -- if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) - ;; 8-reduction.watsup:383.1-384.61 - rule array.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:512.1-515.14 + rule array.init_data-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:386.1-388.38 - rule array.get-oob {a : addr, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) - -- if (a < |$arrayinst(z)|) - -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:507.1-510.59 + rule array.init_data-oob2 {a : addr, i : nat, j : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) - ;; 8-reduction.watsup:390.1-393.53 - rule array.get-array {a : addr, fv : fieldval, i : nat, mut : mut, sx? : sx?, x : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [$admininstr_val($unpackval(zt, sx?{sx}, fv))]) - -- if (i < |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:503.1-505.44 + rule array.init_data-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- if (a < |$arrayinst(z)|) - -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) - -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) + -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:409.1-410.39 - rule array.len-null {ht : heaptype, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) + ;; 8-reduction.watsup:500.1-501.93 + rule array.init_data-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:412.1-414.37 - rule array.len-array {a : addr, n : n, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, n)]) - -- if (a < |$arrayinst(z)|) - -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:492.1-497.34 + rule array.init_elem-succ {a : addr, i : nat, j : nat, n : n, ref : ref, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_ELEM_admininstr(x, y)]) + -- if (j < |$elem(z, y).ELEM_eleminst|) + -- otherwise + -- if (ref = $elem(z, y).ELEM_eleminst[j]) - ;; 8-reduction.watsup:417.1-418.76 - rule array.fill-null {ht : heaptype, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:487.1-490.14 + rule array.init_elem-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:420.1-422.44 - rule array.fill-oob {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:483.1-485.38 + rule array.init_elem-oob2 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) + + ;; 8-reduction.watsup:479.1-481.44 + rule array.init_elem-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) -- if (a < |$arrayinst(z)|) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:424.1-427.14 - rule array.fill-zero {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), []) + ;; 8-reduction.watsup:476.1-477.93 + rule array.init_elem-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + + ;; 8-reduction.watsup:465.1-473.29 + rule array.copy-gt {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise - -- if (n = 0) + -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) + -- if (sx?{sx} = $sxfield(zt_2)) - ;; 8-reduction.watsup:429.1-433.15 - rule array.fill-succ {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.FILL_admininstr(x)]) + ;; 8-reduction.watsup:454.1-463.19 + rule array.copy-le {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, (i_1 + 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise + -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) + -- if (sx?{sx} = $sxfield(zt_2)) + -- if (i_1 <= i_2) - ;; 8-reduction.watsup:435.1-436.102 - rule array.copy-null1 {ht_1 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, i_1) $admininstr_ref(ref) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:449.1-452.14 + rule array.copy-zero {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:438.1-439.102 - rule array.copy-null2 {ht_2 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, i_1) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:445.1-447.48 + rule array.copy-oob2 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if (a_2 < |$arrayinst(z)|) + -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) ;; 8-reduction.watsup:441.1-443.48 rule array.copy-oob1 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: @@ -24324,390 +24506,351 @@ relation Step_read: `%~>%*`(config, admininstr*) -- if (a_1 < |$arrayinst(z)|) -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) - ;; 8-reduction.watsup:445.1-447.48 - rule array.copy-oob2 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if (a_2 < |$arrayinst(z)|) - -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) + ;; 8-reduction.watsup:438.1-439.102 + rule array.copy-null2 {ht_2 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, i_1) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:449.1-452.14 - rule array.copy-zero {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:435.1-436.102 + rule array.copy-null1 {ht_1 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, i_1) $admininstr_ref(ref) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:454.1-463.19 - rule array.copy-le {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, (i_1 + 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) + ;; 8-reduction.watsup:429.1-433.15 + rule array.fill-succ {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.FILL_admininstr(x)]) -- otherwise - -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) - -- if (i_1 <= i_2) - ;; 8-reduction.watsup:465.1-473.29 - rule array.copy-gt {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) + ;; 8-reduction.watsup:424.1-427.14 + rule array.fill-zero {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), []) -- otherwise - -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) - - ;; 8-reduction.watsup:476.1-477.93 - rule array.init_elem-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if (n = 0) - ;; 8-reduction.watsup:479.1-481.44 - rule array.init_elem-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:420.1-422.44 + rule array.fill-oob {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if (a < |$arrayinst(z)|) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:483.1-485.38 - rule array.init_elem-oob2 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) - - ;; 8-reduction.watsup:487.1-490.14 - rule array.init_elem-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:417.1-418.76 + rule array.fill-null {ht : heaptype, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:492.1-497.34 - rule array.init_elem-succ {a : addr, i : nat, j : nat, n : n, ref : ref, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_ELEM_admininstr(x, y)]) - -- if (j < |$elem(z, y).ELEM_eleminst|) - -- otherwise - -- if (ref = $elem(z, y).ELEM_eleminst[j]) + ;; 8-reduction.watsup:412.1-414.37 + rule array.len-array {a : addr, n : n, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, n)]) + -- if (a < |$arrayinst(z)|) + -- if (n = |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:500.1-501.93 - rule array.init_data-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:409.1-410.39 + rule array.len-null {ht : heaptype, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) - ;; 8-reduction.watsup:503.1-505.44 - rule array.init_data-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:390.1-393.53 + rule array.get-array {a : addr, fv : fieldval, i : nat, mut : mut, sx? : sx?, x : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [$admininstr_val($unpackval(zt, sx?{sx}, fv))]) + -- if (i < |$arrayinst(z)[a].FIELD_arrayinst|) -- if (a < |$arrayinst(z)|) - -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) + -- if (fv = $arrayinst(z)[a].FIELD_arrayinst[i]) + -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) - ;; 8-reduction.watsup:507.1-510.59 - rule array.init_data-oob2 {a : addr, i : nat, j : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) + ;; 8-reduction.watsup:386.1-388.38 + rule array.get-oob {a : addr, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + -- if (a < |$arrayinst(z)|) + -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:512.1-515.14 - rule array.init_data-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:383.1-384.61 + rule array.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:517.1-524.67 - rule array.init_data-succ {a : addr, c : c, i : nat, j : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + ($storagesize(zt) / 8))) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_DATA_admininstr(x, y)]) - -- otherwise + ;; 8-reduction.watsup:376.1-380.88 + rule array.new_data-alloc {c^n : c^n, i : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -- if (nt = $unpacknumtype(zt)) - -- if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) + -- if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) - ;; 8-reduction.watsup:545.1-547.27 - rule local.get {val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val(val)]) - -- if ($local(z, x) = ?(val)) + ;; 8-reduction.watsup:371.1-374.59 + rule array.new_data-oob {i : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) - ;; 8-reduction.watsup:558.1-559.45 - rule global.get {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) + ;; 8-reduction.watsup:366.1-368.40 + rule array.new_elem-alloc {i : nat, n : n, ref^n : ref^n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), $admininstr_ref(ref)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) - ;; 8-reduction.watsup:567.1-569.33 - rule table.get-oob {i : nat, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) - -- if (i >= |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:362.1-364.38 + rule array.new_elem-oob {i : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) - ;; 8-reduction.watsup:571.1-573.32 - rule table.get-val {i : nat, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) - -- if (i < |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:351.1-354.40 + rule array.new_default {mut : mut, n : n, val : val, x : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) ARRAY.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ($default($unpacktype(zt)) = ?(val)) - ;; 8-reduction.watsup:584.1-586.32 - rule table.size {n : n, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) - -- if (|$table(z, x).ELEM_tableinst| = n) + ;; 8-reduction.watsup:348.1-349.70 + rule array.new {n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.NEW_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - ;; 8-reduction.watsup:597.1-599.39 - rule table.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:331.1-334.41 + rule struct.get-struct {a : addr, i : nat, mut* : mut*, si : structinst, sx? : sx?, x : idx, z : state, zt* : storagetype*}: + `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [$admininstr_val($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]))]) + -- if (a < |$structinst(z)|) + -- if (|mut*{mut}| = |zt*{zt}|) + -- if (i < |zt*{zt}|) + -- if (i < |si.FIELD_structinst|) + -- if ($structinst(z)[a] = si) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - ;; 8-reduction.watsup:601.1-604.14 - rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:328.1-329.50 + rule struct.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:606.1-610.15 - rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) - -- otherwise - - ;; 8-reduction.watsup:613.1-615.73 - rule table.copy-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) - - ;; 8-reduction.watsup:617.1-620.14 - rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) - - ;; 8-reduction.watsup:622.1-627.15 - rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) - -- otherwise - -- if (j <= i) + ;; 8-reduction.watsup:322.1-325.43 + rule struct.new_default {mut* : mut*, val* : val*, x : idx, z : state, zt* : storagetype*}: + `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)*{val} :: [STRUCT.NEW_admininstr(x)]) + -- if (|mut*{mut}| = |zt*{zt}|) + -- if (|val*{val}| = |zt*{zt}|) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} - ;; 8-reduction.watsup:629.1-633.15 - rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) + ;; 8-reduction.watsup:301.1-303.15 + rule ref.cast-fail {ref : ref, rt : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) -- otherwise - ;; 8-reduction.watsup:636.1-638.72 - rule table.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) - - ;; 8-reduction.watsup:640.1-643.14 - rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:296.1-299.65 + rule ref.cast-succeed {ref : ref, rt : reftype, rt' : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [$admininstr_ref(ref)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt') + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) - ;; 8-reduction.watsup:645.1-649.15 - rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.INIT_admininstr(x, y)]) - -- if (i < |$elem(z, y).ELEM_eleminst|) + ;; 8-reduction.watsup:291.1-293.15 + rule ref.test-false {ref : ref, rt : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 8-reduction.watsup:658.1-660.59 - rule load-num-oob {i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if (((i + mo.OFFSET_memop) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:286.1-289.65 + rule ref.test-true {ref : ref, rt : reftype, rt' : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 1)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt') + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) - ;; 8-reduction.watsup:662.1-664.71 - rule load-num-val {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (o0 / 8)]) + ;; 8-reduction.watsup:247.1-248.55 + rule ref.func {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) + -- if (x < |$funcaddr(z)|) - ;; 8-reduction.watsup:666.1-668.51 - rule load-pack-oob {i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [TRAP_admininstr]) - -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:182.1-183.91 + rule return_call_ref-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) - ;; 8-reduction.watsup:670.1-672.61 - rule load-pack-val {c : c, i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [CONST_admininstr(nt, $ext(n, o0, sx, c))]) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) + ;; 8-reduction.watsup:178.1-180.59 + rule return_call_ref-frame-addr {a : addr, f : frame, instr* : instr*, k : nat, m : m, n : n, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, val'* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) + -- if (a < |$funcinst(z)|) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - ;; 8-reduction.watsup:692.1-694.44 - rule memory.size {n : n, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) - -- if (((n * 64) * $Ki) = |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:175.1-176.78 + rule return_call_ref-frame-null {f : frame, ht : heaptype, instr* : instr*, k : nat, val* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), [TRAP_admininstr]) - ;; 8-reduction.watsup:705.1-707.37 - rule memory.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:171.1-172.76 + rule return_call {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) RETURN_CALL_REF_admininstr(?())]) + -- if (x < |$funcaddr(z)|) - ;; 8-reduction.watsup:709.1-712.14 - rule memory.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:163.1-168.59 + rule call_ref-func {a : addr, f : frame, fi : funcinst, instr* : instr*, m : m, n : n, t* : valtype*, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, x? : idx?, y : idx, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], $admininstr_instr(instr)*{instr})])]) + -- if (a < |$funcinst(z)|) + -- if ($funcinst(z)[a] = fi) + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + -- if (fi.CODE_funcinst = `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr})) + -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) - ;; 8-reduction.watsup:714.1-718.15 - rule memory.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr(x)]) - -- otherwise + ;; 8-reduction.watsup:160.1-161.43 + rule call_ref-null {ht : heaptype, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) - ;; 8-reduction.watsup:721.1-723.77 - rule memory.copy-oob {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) + ;; 8-reduction.watsup:157.1-158.62 + rule call {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) CALL_REF_admininstr(?())]) + -- if (x < |$funcaddr(z)|) - ;; 8-reduction.watsup:725.1-728.14 - rule memory.copy-zero {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), []) + ;; 8-reduction.watsup:150.1-152.15 + rule br_on_cast_fail-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) -- otherwise - -- if (n = 0) - ;; 8-reduction.watsup:730.1-735.19 - rule memory.copy-le {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, (i_1 + 1)) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) - -- otherwise - -- if (i_1 <= i_2) + ;; 8-reduction.watsup:145.1-148.66 + rule br_on_cast_fail-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt) + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) - ;; 8-reduction.watsup:737.1-741.15 - rule memory.copy-gt {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) + ;; 8-reduction.watsup:140.1-142.15 + rule br_on_cast-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) -- otherwise - ;; 8-reduction.watsup:744.1-746.70 - rule memory.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) + ;; 8-reduction.watsup:135.1-138.66 + rule br_on_cast-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt) + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) - ;; 8-reduction.watsup:748.1-751.14 - rule memory.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:72.1-74.43 + rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) - ;; 8-reduction.watsup:753.1-757.15 - rule memory.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, y).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x, y)]) - -- if (i < |$data(z, y).DATA_datainst|) - -- otherwise + ;; 8-reduction.watsup:68.1-70.43 + rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) + -- if ($blocktype(z, bt) = `%->%`(t_1^k{t_1}, t_2^n{t_2})) ;; 8-reduction.watsup:5.1-5.63 relation Step: `%~>%`(config, config) - ;; 8-reduction.watsup:10.1-12.34 - rule pure {instr* : instr*, instr'* : instr*, z : state}: - `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) - -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) + ;; 8-reduction.watsup:760.1-761.51 + rule data.drop {x : idx, z : state}: + `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) - ;; 8-reduction.watsup:14.1-16.37 - rule read {instr* : instr*, instr'* : instr*, z : state}: - `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) - -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) + ;; 8-reduction.watsup:701.1-702.77 + rule memory.grow-fail {n : n, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) - ;; 8-reduction.watsup:317.1-320.61 - rule struct.new {mut^n : mut^n, n : n, si : structinst, val^n : val^n, x : idx, z : state, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) - -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) + ;; 8-reduction.watsup:697.1-699.40 + rule memory.grow-succeed {mi : meminst, n : n, x : idx, z : state, o0 : meminst}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, (|$mem(z, x).DATA_meminst| / (64 * $Ki)))])) + -- if ($growmemory($mem(z, x), n) = ?(o0)) + -- if (mi = o0) - ;; 8-reduction.watsup:337.1-338.53 - rule struct.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`(z, [TRAP_admininstr])) + ;; 8-reduction.watsup:687.1-689.48 + rule store-pack-val {b* : byte*, c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (n / 8), b*{b}), [])) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if (b*{b} = $ibytes(n, $wrap(o0, n, c))) - ;; 8-reduction.watsup:340.1-343.35 - rule struct.set-struct {a : addr, fv : fieldval, i : nat, mut* : mut*, val : val, x : idx, z : state, zt* : storagetype*}: - `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`($with_struct(z, a, i, fv), [])) - -- if (a < |$structinst(z)|) - -- if (|mut*{mut}| = |zt*{zt}|) - -- if (i < |zt*{zt}|) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + ;; 8-reduction.watsup:683.1-685.51 + rule store-pack-oob {c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:356.1-359.61 - rule array.new_fixed {ai : arrayinst, mut : mut, n : n, val^n : val^n, x : idx, z : state, zt : storagetype}: - `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) + ;; 8-reduction.watsup:679.1-681.29 + rule store-num-val {b* : byte*, c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (o0 / 8), b*{b}), [])) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if (b*{b} = $ntbytes(nt, c)) - ;; 8-reduction.watsup:396.1-397.64 - rule array.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + ;; 8-reduction.watsup:675.1-677.59 + rule store-num-oob {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if (((i + mo.OFFSET_memop) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:399.1-401.38 - rule array.set-oob {a : addr, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) - -- if (a < |$arrayinst(z)|) - -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:652.1-653.51 + rule elem.drop {x : idx, z : state}: + `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) - ;; 8-reduction.watsup:403.1-406.31 - rule array.set-array {a : addr, fv : fieldval, i : nat, mut : mut, val : val, x : idx, z : state, zt : storagetype}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) - -- if (a < |$arrayinst(z)|) - -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) - -- if (fv = $packval(zt, val)) + ;; 8-reduction.watsup:593.1-594.80 + rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) - ;; 8-reduction.watsup:549.1-550.56 - rule local.set {val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) + ;; 8-reduction.watsup:589.1-591.46 + rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state, o0 : tableinst}: + `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) + -- if ($growtable($table(z, x), n, ref) = ?(o0)) + -- if (ti = o0) - ;; 8-reduction.watsup:561.1-562.58 - rule global.set {val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) + ;; 8-reduction.watsup:579.1-581.32 + rule table.set-val {i : nat, ref : ref, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) + -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup:575.1-577.33 rule table.set-oob {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:579.1-581.32 - rule table.set-val {i : nat, ref : ref, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) - -- if (i < |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:561.1-562.58 + rule global.set {val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) - ;; 8-reduction.watsup:589.1-591.46 - rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state, o0 : tableinst}: - `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) - -- if ($growtable($table(z, x), n, ref) = ?(o0)) - -- if (ti = o0) + ;; 8-reduction.watsup:549.1-550.56 + rule local.set {val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) - ;; 8-reduction.watsup:593.1-594.80 - rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) + ;; 8-reduction.watsup:403.1-406.31 + rule array.set-array {a : addr, fv : fieldval, i : nat, mut : mut, val : val, x : idx, z : state, zt : storagetype}: + `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) + -- if (a < |$arrayinst(z)|) + -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) + -- if (fv = $packval(zt, val)) - ;; 8-reduction.watsup:652.1-653.51 - rule elem.drop {x : idx, z : state}: - `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) + ;; 8-reduction.watsup:399.1-401.38 + rule array.set-oob {a : addr, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + -- if (a < |$arrayinst(z)|) + -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:675.1-677.59 - rule store-num-oob {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if (((i + mo.OFFSET_memop) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:396.1-397.64 + rule array.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) - ;; 8-reduction.watsup:679.1-681.29 - rule store-num-val {b* : byte*, c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (o0 / 8), b*{b}), [])) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if (b*{b} = $ntbytes(nt, c)) + ;; 8-reduction.watsup:356.1-359.61 + rule array.new_fixed {ai : arrayinst, mut : mut, n : n, val^n : val^n, x : idx, z : state, zt : storagetype}: + `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) - ;; 8-reduction.watsup:683.1-685.51 - rule store-pack-oob {c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:340.1-343.35 + rule struct.set-struct {a : addr, fv : fieldval, i : nat, mut* : mut*, val : val, x : idx, z : state, zt* : storagetype*}: + `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`($with_struct(z, a, i, fv), [])) + -- if (a < |$structinst(z)|) + -- if (|mut*{mut}| = |zt*{zt}|) + -- if (i < |zt*{zt}|) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- if (fv = $packval(zt*{zt}[i], val)) - ;; 8-reduction.watsup:687.1-689.48 - rule store-pack-val {b* : byte*, c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (n / 8), b*{b}), [])) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if (b*{b} = $ibytes(n, $wrap(o0, n, c))) + ;; 8-reduction.watsup:337.1-338.53 + rule struct.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`(z, [TRAP_admininstr])) - ;; 8-reduction.watsup:697.1-699.40 - rule memory.grow-succeed {mi : meminst, n : n, x : idx, z : state, o0 : meminst}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, (|$mem(z, x).DATA_meminst| / (64 * $Ki)))])) - -- if ($growmemory($mem(z, x), n) = ?(o0)) - -- if (mi = o0) + ;; 8-reduction.watsup:317.1-320.61 + rule struct.new {mut^n : mut^n, n : n, si : structinst, val^n : val^n, x : idx, z : state, zt^n : storagetype^n}: + `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) + -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) - ;; 8-reduction.watsup:701.1-702.77 - rule memory.grow-fail {n : n, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) + ;; 8-reduction.watsup:14.1-16.37 + rule read {instr* : instr*, instr'* : instr*, z : state}: + `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) + -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) - ;; 8-reduction.watsup:760.1-761.51 - rule data.drop {x : idx, z : state}: - `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) + ;; 8-reduction.watsup:10.1-12.34 + rule pure {instr* : instr*, instr'* : instr*, z : state}: + `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) + -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) ;; 8-reduction.watsup:8.1-8.63 rec { ;; 8-reduction.watsup:8.1-8.63 relation Steps: `%~>*%`(config, config) - ;; 8-reduction.watsup:18.1-19.36 - rule refl {admininstr* : admininstr*, z : state}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) - ;; 8-reduction.watsup:21.1-24.53 rule trans {admininstr* : admininstr*, admininstr' : admininstr, admininstr''* : admininstr*, z : state, z' : state, z'' : state}: `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z'', admininstr''*{admininstr''})) -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z', admininstr'*{})) -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr''})) + + ;; 8-reduction.watsup:18.1-19.36 + rule refl {admininstr* : admininstr*, z : state}: + `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) } ;; 8-reduction.watsup:29.1-29.69 @@ -24722,14 +24865,14 @@ rec { ;; 9-module.watsup:7.1-7.34 def alloctypes : type* -> deftype* - ;; 9-module.watsup:8.1-8.27 - def alloctypes([]) = [] ;; 9-module.watsup:9.1-13.24 def {deftype* : deftype*, deftype'* : deftype*, rectype : rectype, type : type, type'* : type*, x : idx} alloctypes(type'*{type'} :: [type]) = deftype'*{deftype'} :: deftype*{deftype} -- if (deftype'*{deftype'} = $alloctypes(type'*{type'})) -- if (type = TYPE(rectype)) -- if (deftype*{deftype} = $subst_all_deftypes($rolldt(x, rectype), $heaptype_deftype(deftype')*{deftype'})) -- if (x = |deftype'*{deftype'}|) + ;; 9-module.watsup:8.1-8.27 + def alloctypes([]) = [] } ;; 9-module.watsup:15.1-15.60 @@ -24744,12 +24887,12 @@ rec { ;; 9-module.watsup:20.1-20.63 def allocfuncs : (store, moduleinst, func*) -> (store, funcaddr*) - ;; 9-module.watsup:21.1-21.39 - def {mm : moduleinst, s : store} allocfuncs(s, mm, []) = (s, []) ;; 9-module.watsup:22.1-24.51 def {fa : funcaddr, fa'* : funcaddr*, func : func, func'* : func*, mm : moduleinst, s : store, s_1 : store, s_2 : store} allocfuncs(s, mm, [func] :: func'*{func'}) = (s_2, [fa] :: fa'*{fa'}) -- if ((s_1, fa) = $allocfunc(s, mm, func)) -- if ((s_2, fa'*{fa'}) = $allocfuncs(s_1, mm, func'*{func'})) + ;; 9-module.watsup:21.1-21.39 + def {mm : moduleinst, s : store} allocfuncs(s, mm, []) = (s, []) } ;; 9-module.watsup:26.1-26.63 @@ -24763,12 +24906,12 @@ rec { ;; 9-module.watsup:30.1-30.67 def allocglobals : (store, globaltype*, val*) -> (store, globaladdr*) - ;; 9-module.watsup:31.1-31.42 - def {s : store} allocglobals(s, [], []) = (s, []) ;; 9-module.watsup:32.1-34.62 def {ga : globaladdr, ga'* : globaladdr*, globaltype : globaltype, globaltype'* : globaltype*, s : store, s_1 : store, s_2 : store, val : val, val'* : val*} allocglobals(s, [globaltype] :: globaltype'*{globaltype'}, [val] :: val'*{val'}) = (s_2, [ga] :: ga'*{ga'}) -- if ((s_1, ga) = $allocglobal(s, globaltype, val)) -- if ((s_2, ga'*{ga'}) = $allocglobals(s_1, globaltype'*{globaltype'}, val'*{val'})) + ;; 9-module.watsup:31.1-31.42 + def {s : store} allocglobals(s, [], []) = (s, []) } ;; 9-module.watsup:36.1-36.60 @@ -24782,12 +24925,12 @@ rec { ;; 9-module.watsup:40.1-40.64 def alloctables : (store, tabletype*, ref*) -> (store, tableaddr*) - ;; 9-module.watsup:41.1-41.41 - def {s : store} alloctables(s, [], []) = (s, []) ;; 9-module.watsup:42.1-44.60 def {ref : ref, ref'* : ref*, s : store, s_1 : store, s_2 : store, ta : tableaddr, ta'* : tableaddr*, tabletype : tabletype, tabletype'* : tabletype*} alloctables(s, [tabletype] :: tabletype'*{tabletype'}, [ref] :: ref'*{ref'}) = (s_2, [ta] :: ta'*{ta'}) -- if ((s_1, ta) = $alloctable(s, tabletype, ref)) -- if ((s_2, ta'*{ta'}) = $alloctables(s_1, tabletype'*{tabletype'}, ref'*{ref'})) + ;; 9-module.watsup:41.1-41.41 + def {s : store} alloctables(s, [], []) = (s, []) } ;; 9-module.watsup:46.1-46.49 @@ -24801,12 +24944,12 @@ rec { ;; 9-module.watsup:50.1-50.52 def allocmems : (store, memtype*) -> (store, memaddr*) - ;; 9-module.watsup:51.1-51.34 - def {s : store} allocmems(s, []) = (s, []) ;; 9-module.watsup:52.1-54.49 def {ma : memaddr, ma'* : memaddr*, memtype : memtype, memtype'* : memtype*, s : store, s_1 : store, s_2 : store} allocmems(s, [memtype] :: memtype'*{memtype'}) = (s_2, [ma] :: ma'*{ma'}) -- if ((s_1, ma) = $allocmem(s, memtype)) -- if ((s_2, ma'*{ma'}) = $allocmems(s_1, memtype'*{memtype'})) + ;; 9-module.watsup:51.1-51.34 + def {s : store} allocmems(s, []) = (s, []) } ;; 9-module.watsup:56.1-56.57 @@ -24820,12 +24963,12 @@ rec { ;; 9-module.watsup:60.1-60.63 def allocelems : (store, reftype*, ref**) -> (store, elemaddr*) - ;; 9-module.watsup:61.1-61.40 - def {s : store} allocelems(s, [], []) = (s, []) ;; 9-module.watsup:62.1-64.55 def {ea : elemaddr, ea'* : elemaddr*, ref* : ref*, ref'** : ref**, rt : reftype, rt'* : reftype*, s : store, s_1 : store, s_2 : store} allocelems(s, [rt] :: rt'*{rt'}, [ref*{ref}] :: ref'*{ref'}*{ref'}) = (s_2, [ea] :: ea'*{ea'}) -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref})) -- if ((s_2, ea'*{ea'}) = $allocelems(s_2, rt'*{rt'}, ref'*{ref'}*{ref'})) + ;; 9-module.watsup:61.1-61.40 + def {s : store} allocelems(s, [], []) = (s, []) } ;; 9-module.watsup:66.1-66.49 @@ -24839,24 +24982,24 @@ rec { ;; 9-module.watsup:70.1-70.54 def allocdatas : (store, byte**) -> (store, dataaddr*) - ;; 9-module.watsup:71.1-71.35 - def {s : store} allocdatas(s, []) = (s, []) ;; 9-module.watsup:72.1-74.50 def {byte* : byte*, byte'** : byte**, da : dataaddr, da'* : dataaddr*, s : store, s_1 : store, s_2 : store} allocdatas(s, [byte*{byte}] :: byte'*{byte'}*{byte'}) = (s_2, [da] :: da'*{da'}) -- if ((s_1, da) = $allocdata(s, byte*{byte})) -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) + ;; 9-module.watsup:71.1-71.35 + def {s : store} allocdatas(s, []) = (s, []) } ;; 9-module.watsup:79.1-79.83 def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst - ;; 9-module.watsup:80.1-80.95 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} - ;; 9-module.watsup:81.1-81.99 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} - ;; 9-module.watsup:82.1-82.97 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} ;; 9-module.watsup:83.1-83.93 def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} + ;; 9-module.watsup:82.1-82.97 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} + ;; 9-module.watsup:81.1-81.99 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} + ;; 9-module.watsup:80.1-80.95 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} ;; 9-module.watsup:86.1-86.87 def allocmodule : (store, module, externval*, val*, ref*, ref**) -> (store, moduleinst) @@ -24888,27 +25031,27 @@ rec { ;; 9-module.watsup:134.1-134.38 def concat_instr : instr** -> instr* - ;; 9-module.watsup:135.1-135.29 - def concat_instr([]) = [] ;; 9-module.watsup:136.1-136.74 def {instr* : instr*, instr'** : instr**} concat_instr([instr*{instr}] :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) + ;; 9-module.watsup:135.1-135.29 + def concat_instr([]) = [] } ;; 9-module.watsup:138.1-138.33 def runelem : (elem, idx) -> instr* - ;; 9-module.watsup:139.1-139.52 - def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, PASSIVE_elemmode), y) = [] - ;; 9-module.watsup:140.1-140.62 - def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] ;; 9-module.watsup:141.1-142.77 def {expr* : expr*, instr* : instr*, reftype : reftype, x : idx, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, ACTIVE_elemmode(x, instr*{instr})), y) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, |expr*{expr}|) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] + ;; 9-module.watsup:140.1-140.62 + def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] + ;; 9-module.watsup:139.1-139.52 + def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, PASSIVE_elemmode), y) = [] ;; 9-module.watsup:144.1-144.33 def rundata : (data, idx) -> instr* - ;; 9-module.watsup:145.1-145.44 - def {byte* : byte*, y : idx} rundata(`DATA%*%`(byte*{byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup:146.1-147.78 def {byte* : byte*, instr* : instr*, x : idx, y : idx} rundata(`DATA%*%`(byte*{byte}, ACTIVE_datamode(x, instr*{instr})), y) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, |byte*{byte}|) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] + ;; 9-module.watsup:145.1-145.44 + def {byte* : byte*, y : idx} rundata(`DATA%*%`(byte*{byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup:149.1-149.53 def instantiate : (store, module, externval*) -> config @@ -24945,20 +25088,20 @@ rec { ;; A-binary.watsup:47.1-47.24 def utf8 : name -> byte* - ;; A-binary.watsup:48.1-48.44 - def {b : byte, c : c} utf8([c]) = [b] - -- if ((c < 128) /\ (c = b)) - ;; A-binary.watsup:49.1-49.93 - def {b_1 : byte, b_2 : byte, c : c} utf8([c]) = [b_1 b_2] - -- if (((128 <= c) /\ (c < 2048)) /\ (c = (((2 ^ 6) * (b_1 - 192)) + (b_2 - 128)))) - ;; A-binary.watsup:50.1-50.144 - def {b_1 : byte, b_2 : byte, b_3 : byte, c : c} utf8([c]) = [b_1 b_2 b_3] - -- if ((((2048 <= c) /\ (c < 55296)) \/ ((57344 <= c) /\ (c < 65536))) /\ (c = ((((2 ^ 12) * (b_1 - 224)) + ((2 ^ 6) * (b_2 - 128))) + (b_3 - 128)))) + ;; A-binary.watsup:52.1-52.41 + def {c* : c*} utf8(c*{c}) = $concat_bytes($utf8([c])*{c}) ;; A-binary.watsup:51.1-51.145 def {b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte, c : c} utf8([c]) = [b_1 b_2 b_3 b_4] -- if (((65536 <= c) /\ (c < 69632)) /\ (c = (((((2 ^ 18) * (b_1 - 240)) + ((2 ^ 12) * (b_2 - 128))) + ((2 ^ 6) * (b_3 - 128))) + (b_4 - 128)))) - ;; A-binary.watsup:52.1-52.41 - def {c* : c*} utf8(c*{c}) = $concat_bytes($utf8([c])*{c}) + ;; A-binary.watsup:50.1-50.144 + def {b_1 : byte, b_2 : byte, b_3 : byte, c : c} utf8([c]) = [b_1 b_2 b_3] + -- if ((((2048 <= c) /\ (c < 55296)) \/ ((57344 <= c) /\ (c < 65536))) /\ (c = ((((2 ^ 12) * (b_1 - 224)) + ((2 ^ 6) * (b_2 - 128))) + (b_3 - 128)))) + ;; A-binary.watsup:49.1-49.93 + def {b_1 : byte, b_2 : byte, c : c} utf8([c]) = [b_1 b_2] + -- if (((128 <= c) /\ (c < 2048)) /\ (c = (((2 ^ 6) * (b_1 - 192)) + (b_2 - 128)))) + ;; A-binary.watsup:48.1-48.44 + def {b : byte, c : c} utf8([c]) = [b] + -- if ((c < 128) /\ (c = b)) } ;; A-binary.watsup:210.1-210.27 @@ -24972,10 +25115,10 @@ rec { ;; A-binary.watsup:665.1-665.62 def concat_locals : local** -> local* - ;; A-binary.watsup:666.1-666.30 - def concat_locals([]) = [] ;; A-binary.watsup:667.1-667.68 def {loc* : local*, loc'** : local**} concat_locals([loc*{loc}] :: loc'*{loc'}*{loc'}) = loc*{loc} :: $concat_locals(loc'*{loc'}*{loc'}) + ;; A-binary.watsup:666.1-666.30 + def concat_locals([]) = [] } ;; A-binary.watsup:670.1-670.29 @@ -24984,54 +25127,54 @@ syntax code = (local*, expr) == IL Validation after pass sideconditions... == Running pass animate... Animation failed:if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) -Animation failed:Ref_ok: `%|-%:%`($store(z), ref, rt) -Animation failed:Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) -Animation failed:Ref_ok: `%|-%:%`($store(z), ref, rt) -Animation failed:Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) -Animation failed:Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) -Animation failed:if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) -Animation failed:Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) -Animation failed:Ref_ok: `%|-%:%`($store(z), ref, rt') -Animation failed:Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) -Animation failed:Ref_ok: `%|-%:%`($store(z), ref, rt') -Animation failed:Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) -Animation failed:if (|mut*{mut}| = |zt*{zt}|) -Animation failed:if (|val*{val}| = |zt*{zt}|) -Animation failed:Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) -Animation failed:(if ($default($unpacktype(zt)) = ?(val)))*{val zt} -Animation failed:if (|mut*{mut}| = |zt*{zt}|) -Animation failed:if (i < |zt*{zt}|) -Animation failed:Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) -Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -Animation failed:if ($default($unpacktype(zt)) = ?(val)) -Animation failed:if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) -Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -Animation failed:if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) +Animation failed:if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) +Animation failed:if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (o0 / 8)]) Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) Animation failed:if (nt = $unpacknumtype(zt)) -Animation failed:if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) -Animation failed:Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) +Animation failed:if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) +Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) +Animation failed:if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) Animation failed:Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) Animation failed:if (sx?{sx} = $sxfield(zt_2)) Animation failed:Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) Animation failed:if (sx?{sx} = $sxfield(zt_2)) -Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -Animation failed:if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) +Animation failed:Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) Animation failed:if (nt = $unpacknumtype(zt)) -Animation failed:if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) -Animation failed:if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (o0 / 8)]) -Animation failed:if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) -Animation failed:Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) -Animation failed:if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) +Animation failed:if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) +Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) +Animation failed:if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) +Animation failed:if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) +Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) +Animation failed:if ($default($unpacktype(zt)) = ?(val)) Animation failed:if (|mut*{mut}| = |zt*{zt}|) Animation failed:if (i < |zt*{zt}|) -Animation failed:Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) -Animation failed:if (fv = $packval(zt*{zt}[i], val)) -Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -Animation failed:if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) -Animation failed:Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) -Animation failed:if (fv = $packval(zt, val)) +Animation failed:Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) +Animation failed:if (|mut*{mut}| = |zt*{zt}|) +Animation failed:if (|val*{val}| = |zt*{zt}|) +Animation failed:Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) +Animation failed:(if ($default($unpacktype(zt)) = ?(val)))*{val zt} +Animation failed:Ref_ok: `%|-%:%`($store(z), ref, rt') +Animation failed:Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) +Animation failed:Ref_ok: `%|-%:%`($store(z), ref, rt') +Animation failed:Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) +Animation failed:Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) +Animation failed:Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) +Animation failed:if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) +Animation failed:Ref_ok: `%|-%:%`($store(z), ref, rt) +Animation failed:Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) +Animation failed:Ref_ok: `%|-%:%`($store(z), ref, rt) +Animation failed:Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) +Animation failed:Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) +Animation failed:if (fv = $packval(zt, val)) +Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) +Animation failed:if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) +Animation failed:if (|mut*{mut}| = |zt*{zt}|) +Animation failed:if (i < |zt*{zt}|) +Animation failed:Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) +Animation failed:if (fv = $packval(zt*{zt}[i], val)) +Animation failed:Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) +Animation failed:if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) ;; 0-aux.watsup:11.1-11.15 syntax N = nat @@ -25055,12 +25198,12 @@ rec { ;; 0-aux.watsup:27.1-27.25 def min : (nat, nat) -> nat - ;; 0-aux.watsup:28.1-28.19 - def {j : nat} min(0, j) = 0 - ;; 0-aux.watsup:29.1-29.19 - def {i : nat} min(i, 0) = 0 ;; 0-aux.watsup:30.1-30.38 def {i : nat, j : nat} min((i + 1), (j + 1)) = $min(i, j) + ;; 0-aux.watsup:29.1-29.19 + def {i : nat} min(i, 0) = 0 + ;; 0-aux.watsup:28.1-28.19 + def {j : nat} min(0, j) = 0 } ;; 0-aux.watsup:32.1-32.21 @@ -25068,10 +25211,10 @@ rec { ;; 0-aux.watsup:32.1-32.21 def sum : nat* -> nat - ;; 0-aux.watsup:33.1-33.18 - def sum([]) = 0 ;; 0-aux.watsup:34.1-34.35 def {n : n, n'* : n*} sum([n] :: n'*{n'}) = (n + $sum(n'*{n'})) + ;; 0-aux.watsup:33.1-33.18 + def sum([]) = 0 } ;; 1-syntax.watsup:5.1-5.85 @@ -25109,17 +25252,17 @@ syntax s33 = sN ;; 1-syntax.watsup:35.1-35.21 def signif : N -> nat - ;; 1-syntax.watsup:36.1-36.21 - def signif(32) = 23 ;; 1-syntax.watsup:37.1-37.21 def signif(64) = 52 + ;; 1-syntax.watsup:36.1-36.21 + def signif(32) = 23 ;; 1-syntax.watsup:39.1-39.20 def expon : N -> nat - ;; 1-syntax.watsup:40.1-40.19 - def expon(32) = 8 ;; 1-syntax.watsup:41.1-41.20 def expon(64) = 11 + ;; 1-syntax.watsup:40.1-40.19 + def expon(32) = 8 ;; 1-syntax.watsup:43.1-43.35 def M : N -> nat @@ -25665,14 +25808,14 @@ rec { ;; 2-syntax-aux.watsup:8.1-8.33 def setminus1 : (idx, idx*) -> idx* - ;; 2-syntax-aux.watsup:13.1-13.27 - def {x : idx} setminus1(x, []) = [x] - ;; 2-syntax-aux.watsup:14.1-14.57 - def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = [] - -- if (x = y_1) ;; 2-syntax-aux.watsup:15.1-15.60 def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = $setminus1(x, y*{y}) -- otherwise + ;; 2-syntax-aux.watsup:14.1-14.57 + def {x : idx, y* : idx*, y_1 : idx} setminus1(x, [y_1] :: y*{y}) = [] + -- if (x = y_1) + ;; 2-syntax-aux.watsup:13.1-13.27 + def {x : idx} setminus1(x, []) = [x] } ;; 2-syntax-aux.watsup:7.1-7.49 @@ -25680,30 +25823,30 @@ rec { ;; 2-syntax-aux.watsup:7.1-7.49 def setminus : (idx*, idx*) -> idx* - ;; 2-syntax-aux.watsup:10.1-10.29 - def {y* : idx*} setminus([], y*{y}) = [] ;; 2-syntax-aux.watsup:11.1-11.66 def {x* : idx*, x_1 : idx, y* : idx*} setminus([x_1] :: x*{x}, y*{y}) = $setminus1(x_1, y*{y}) :: $setminus(x*{x}, y*{y}) + ;; 2-syntax-aux.watsup:10.1-10.29 + def {y* : idx*} setminus([], y*{y}) = [] } ;; 2-syntax-aux.watsup:20.1-20.68 def free_dataidx_instr : instr -> dataidx* - ;; 2-syntax-aux.watsup:21.1-21.45 - def {x : idx, y : idx} free_dataidx_instr(MEMORY.INIT_instr(x, y)) = [y] - ;; 2-syntax-aux.watsup:22.1-22.41 - def {x : idx} free_dataidx_instr(DATA.DROP_instr(x)) = [x] ;; 2-syntax-aux.watsup:23.1-23.34 def {in : instr} free_dataidx_instr(in) = [] + ;; 2-syntax-aux.watsup:22.1-22.41 + def {x : idx} free_dataidx_instr(DATA.DROP_instr(x)) = [x] + ;; 2-syntax-aux.watsup:21.1-21.45 + def {x : idx, y : idx} free_dataidx_instr(MEMORY.INIT_instr(x, y)) = [y] ;; 2-syntax-aux.watsup:25.1-25.70 rec { ;; 2-syntax-aux.watsup:25.1-25.70 def free_dataidx_instrs : instr* -> dataidx* - ;; 2-syntax-aux.watsup:26.1-26.36 - def free_dataidx_instrs([]) = [] ;; 2-syntax-aux.watsup:27.1-27.99 def {instr : instr, instr'* : instr*} free_dataidx_instrs([instr] :: instr'*{instr'}) = $free_dataidx_instr(instr) :: $free_dataidx_instrs(instr'*{instr'}) + ;; 2-syntax-aux.watsup:26.1-26.36 + def free_dataidx_instrs([]) = [] } ;; 2-syntax-aux.watsup:29.1-29.66 @@ -25721,10 +25864,10 @@ rec { ;; 2-syntax-aux.watsup:35.1-35.68 def free_dataidx_funcs : func* -> dataidx* - ;; 2-syntax-aux.watsup:36.1-36.35 - def free_dataidx_funcs([]) = [] ;; 2-syntax-aux.watsup:37.1-37.92 def {func : func, func'* : func*} free_dataidx_funcs([func] :: func'*{func'}) = $free_dataidx_func(func) :: $free_dataidx_funcs(func'*{func'}) + ;; 2-syntax-aux.watsup:36.1-36.35 + def free_dataidx_funcs([]) = [] } ;; 2-syntax-aux.watsup:46.1-46.59 @@ -25732,67 +25875,67 @@ rec { ;; 2-syntax-aux.watsup:46.1-46.59 def concat_bytes : byte** -> byte* - ;; 2-syntax-aux.watsup:47.1-47.29 - def concat_bytes([]) = [] ;; 2-syntax-aux.watsup:48.1-48.58 def {b* : byte*, b'** : byte**} concat_bytes([b*{b}] :: b'*{b'}*{b'}) = b*{b} :: $concat_bytes(b'*{b'}*{b'}) + ;; 2-syntax-aux.watsup:47.1-47.29 + def concat_bytes([]) = [] } ;; 2-syntax-aux.watsup:59.1-59.55 def size : valtype -> nat? - ;; 2-syntax-aux.watsup:60.1-60.20 - def size(I32_valtype) = ?(32) - ;; 2-syntax-aux.watsup:61.1-61.20 - def size(I64_valtype) = ?(64) - ;; 2-syntax-aux.watsup:62.1-62.20 - def size(F32_valtype) = ?(32) - ;; 2-syntax-aux.watsup:63.1-63.20 - def size(F64_valtype) = ?(64) ;; 2-syntax-aux.watsup:64.1-64.22 def size(V128_valtype) = ?(128) + ;; 2-syntax-aux.watsup:63.1-63.20 + def size(F64_valtype) = ?(64) + ;; 2-syntax-aux.watsup:62.1-62.20 + def size(F32_valtype) = ?(32) + ;; 2-syntax-aux.watsup:61.1-61.20 + def size(I64_valtype) = ?(64) + ;; 2-syntax-aux.watsup:60.1-60.20 + def size(I32_valtype) = ?(32) def {x : valtype} size(x) = ?() ;; 2-syntax-aux.watsup:66.1-66.50 def packedsize : packedtype -> nat - ;; 2-syntax-aux.watsup:67.1-67.24 - def packedsize(I8_packedtype) = 8 ;; 2-syntax-aux.watsup:68.1-68.26 def packedsize(I16_packedtype) = 16 + ;; 2-syntax-aux.watsup:67.1-67.24 + def packedsize(I8_packedtype) = 8 ;; 2-syntax-aux.watsup:70.1-70.52 def storagesize : storagetype -> nat - ;; 2-syntax-aux.watsup:71.1-71.43 - def {valtype : valtype} storagesize($storagetype_valtype(valtype)) = !($size(valtype)) ;; 2-syntax-aux.watsup:72.1-72.55 def {packedtype : packedtype} storagesize($storagetype_packedtype(packedtype)) = $packedsize(packedtype) + ;; 2-syntax-aux.watsup:71.1-71.43 + def {valtype : valtype} storagesize($storagetype_valtype(valtype)) = !($size(valtype)) ;; 2-syntax-aux.watsup:77.1-77.62 def unpacktype : storagetype -> valtype - ;; 2-syntax-aux.watsup:78.1-78.35 - def {valtype : valtype} unpacktype($storagetype_valtype(valtype)) = valtype ;; 2-syntax-aux.watsup:79.1-79.34 def {packedtype : packedtype} unpacktype($storagetype_packedtype(packedtype)) = I32_valtype + ;; 2-syntax-aux.watsup:78.1-78.35 + def {valtype : valtype} unpacktype($storagetype_valtype(valtype)) = valtype ;; 2-syntax-aux.watsup:81.1-81.65 def unpacknumtype : storagetype -> numtype - ;; 2-syntax-aux.watsup:82.1-82.38 - def {numtype : numtype} unpacknumtype($storagetype_numtype(numtype)) = numtype ;; 2-syntax-aux.watsup:83.1-83.37 def {packedtype : packedtype} unpacknumtype($storagetype_packedtype(packedtype)) = I32_numtype + ;; 2-syntax-aux.watsup:82.1-82.38 + def {numtype : numtype} unpacknumtype($storagetype_numtype(numtype)) = numtype ;; 2-syntax-aux.watsup:85.1-85.51 def sxfield : storagetype -> sx? - ;; 2-syntax-aux.watsup:86.1-86.28 - def {valtype : valtype} sxfield($storagetype_valtype(valtype)) = ?() ;; 2-syntax-aux.watsup:87.1-87.29 def {packedtype : packedtype} sxfield($storagetype_packedtype(packedtype)) = ?(S_sx) + ;; 2-syntax-aux.watsup:86.1-86.28 + def {valtype : valtype} sxfield($storagetype_valtype(valtype)) = ?() ;; 2-syntax-aux.watsup:92.1-92.59 def diffrt : (reftype, reftype) -> reftype - ;; 2-syntax-aux.watsup:94.1-94.64 - def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) = REF_reftype(`NULL%?`(?()), ht_1) ;; 2-syntax-aux.watsup:95.1-95.65 def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?()), ht_2)) = REF_reftype(nul_1, ht_1) + ;; 2-syntax-aux.watsup:94.1-94.64 + def {ht_1 : heaptype, ht_2 : heaptype, nul_1 : nul} diffrt(REF_reftype(nul_1, ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) = REF_reftype(`NULL%?`(?()), ht_1) ;; 2-syntax-aux.watsup:100.1-100.42 syntax typevar = @@ -25813,14 +25956,14 @@ rec { ;; 2-syntax-aux.watsup:109.1-109.92 def subst_typevar : (typevar, typevar*, heaptype*) -> heaptype - ;; 2-syntax-aux.watsup:134.1-134.38 - def {xx : typevar} subst_typevar(xx, [], []) = $heaptype_typevar(xx) - ;; 2-syntax-aux.watsup:135.1-135.95 - def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 - -- if (xx = xx_1) ;; 2-syntax-aux.watsup:136.1-136.92 def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = $subst_typevar(xx, xx'*{xx'}, ht'*{ht'}) -- otherwise + ;; 2-syntax-aux.watsup:135.1-135.95 + def {ht'* : heaptype*, ht_1 : heaptype, xx : typevar, xx'* : typevar*, xx_1 : typevar} subst_typevar(xx, [xx_1] :: xx'*{xx'}, [ht_1] :: ht'*{ht'}) = ht_1 + -- if (xx = xx_1) + ;; 2-syntax-aux.watsup:134.1-134.38 + def {xx : typevar} subst_typevar(xx, [], []) = $heaptype_typevar(xx) } ;; 2-syntax-aux.watsup:111.1-111.92 @@ -25843,13 +25986,13 @@ rec { ;; 2-syntax-aux.watsup:113.1-113.92 def subst_heaptype : (heaptype, typevar*, heaptype*) -> heaptype - ;; 2-syntax-aux.watsup:141.1-141.67 - def {ht* : heaptype*, xx* : typevar*, xx' : typevar} subst_heaptype($heaptype_typevar(xx'), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) - ;; 2-syntax-aux.watsup:142.1-142.65 - def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_heaptype($heaptype_deftype(dt), xx*{xx}, ht*{ht}) = $heaptype_deftype($subst_deftype(dt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:143.1-143.55 def {ht* : heaptype*, ht' : heaptype, xx* : typevar*} subst_heaptype(ht', xx*{xx}, ht*{ht}) = ht' -- otherwise + ;; 2-syntax-aux.watsup:142.1-142.65 + def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_heaptype($heaptype_deftype(dt), xx*{xx}, ht*{ht}) = $heaptype_deftype($subst_deftype(dt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:141.1-141.67 + def {ht* : heaptype*, xx* : typevar*, xx' : typevar} subst_heaptype($heaptype_typevar(xx'), xx*{xx}, ht*{ht}) = $subst_typevar(xx', xx*{xx}, ht*{ht}) ;; 2-syntax-aux.watsup:114.1-114.92 def subst_reftype : (reftype, typevar*, heaptype*) -> reftype @@ -25858,21 +26001,21 @@ def subst_reftype : (reftype, typevar*, heaptype*) -> reftype ;; 2-syntax-aux.watsup:115.1-115.92 def subst_valtype : (valtype, typevar*, heaptype*) -> valtype - ;; 2-syntax-aux.watsup:147.1-147.64 - def {ht* : heaptype*, nt : numtype, xx* : typevar*} subst_valtype($valtype_numtype(nt), xx*{xx}, ht*{ht}) = $valtype_numtype($subst_numtype(nt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:148.1-148.64 - def {ht* : heaptype*, vt : vectype, xx* : typevar*} subst_valtype($valtype_vectype(vt), xx*{xx}, ht*{ht}) = $valtype_vectype($subst_vectype(vt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:149.1-149.64 - def {ht* : heaptype*, rt : reftype, xx* : typevar*} subst_valtype($valtype_reftype(rt), xx*{xx}, ht*{ht}) = $valtype_reftype($subst_reftype(rt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:150.1-150.40 def {ht* : heaptype*, xx* : typevar*} subst_valtype(BOT_valtype, xx*{xx}, ht*{ht}) = BOT_valtype + ;; 2-syntax-aux.watsup:149.1-149.64 + def {ht* : heaptype*, rt : reftype, xx* : typevar*} subst_valtype($valtype_reftype(rt), xx*{xx}, ht*{ht}) = $valtype_reftype($subst_reftype(rt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:148.1-148.64 + def {ht* : heaptype*, vt : vectype, xx* : typevar*} subst_valtype($valtype_vectype(vt), xx*{xx}, ht*{ht}) = $valtype_vectype($subst_vectype(vt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:147.1-147.64 + def {ht* : heaptype*, nt : numtype, xx* : typevar*} subst_valtype($valtype_numtype(nt), xx*{xx}, ht*{ht}) = $valtype_numtype($subst_numtype(nt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:118.1-118.92 def subst_storagetype : (storagetype, typevar*, heaptype*) -> storagetype - ;; 2-syntax-aux.watsup:154.1-154.66 - def {ht* : heaptype*, t : valtype, xx* : typevar*} subst_storagetype($storagetype_valtype(t), xx*{xx}, ht*{ht}) = $storagetype_valtype($subst_valtype(t, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:155.1-155.71 def {ht* : heaptype*, pt : packedtype, xx* : typevar*} subst_storagetype($storagetype_packedtype(pt), xx*{xx}, ht*{ht}) = $storagetype_packedtype($subst_packedtype(pt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:154.1-154.66 + def {ht* : heaptype*, t : valtype, xx* : typevar*} subst_storagetype($storagetype_valtype(t), xx*{xx}, ht*{ht}) = $storagetype_valtype($subst_valtype(t, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:119.1-119.92 def subst_fieldtype : (fieldtype, typevar*, heaptype*) -> fieldtype @@ -25881,19 +26024,19 @@ def subst_fieldtype : (fieldtype, typevar*, heaptype*) -> fieldtype ;; 2-syntax-aux.watsup:121.1-121.92 def subst_comptype : (comptype, typevar*, heaptype*) -> comptype - ;; 2-syntax-aux.watsup:159.1-159.85 - def {ht* : heaptype*, xx* : typevar*, yt* : fieldtype*} subst_comptype(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) - ;; 2-syntax-aux.watsup:160.1-160.81 - def {ht* : heaptype*, xx* : typevar*, yt : fieldtype} subst_comptype(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:161.1-161.78 def {ft : functype, ht* : heaptype*, xx* : typevar*} subst_comptype(FUNC_comptype(ft), xx*{xx}, ht*{ht}) = FUNC_comptype($subst_functype(ft, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:160.1-160.81 + def {ht* : heaptype*, xx* : typevar*, yt : fieldtype} subst_comptype(ARRAY_comptype(yt), xx*{xx}, ht*{ht}) = ARRAY_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:159.1-159.85 + def {ht* : heaptype*, xx* : typevar*, yt* : fieldtype*} subst_comptype(STRUCT_comptype(yt*{yt}), xx*{xx}, ht*{ht}) = STRUCT_comptype($subst_fieldtype(yt, xx*{xx}, ht*{ht})*{yt}) ;; 2-syntax-aux.watsup:122.1-122.92 def subst_subtype : (subtype, typevar*, heaptype*) -> subtype - ;; 2-syntax-aux.watsup:163.1-164.76 - def {ct : comptype, fin : fin, ht* : heaptype*, xx* : typevar*, y* : idx*} subst_subtype(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:165.1-166.73 def {ct : comptype, fin : fin, ht* : heaptype*, ht'* : heaptype*, xx* : typevar*} subst_subtype(SUBD_subtype(fin, ht'*{ht'}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(ht', xx*{xx}, ht*{ht})*{ht'}, $subst_comptype(ct, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:163.1-164.76 + def {ct : comptype, fin : fin, ht* : heaptype*, xx* : typevar*, y* : idx*} subst_subtype(SUB_subtype(fin, y*{y}, ct), xx*{xx}, ht*{ht}) = SUBD_subtype(fin, $subst_heaptype(_IDX_heaptype(y), xx*{xx}, ht*{ht})*{y}, $subst_comptype(ct, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:123.1-123.92 def subst_rectype : (rectype, typevar*, heaptype*) -> rectype @@ -25928,14 +26071,14 @@ def subst_memtype : (memtype, typevar*, heaptype*) -> memtype ;; 2-syntax-aux.watsup:131.1-131.92 def subst_externtype : (externtype, typevar*, heaptype*) -> externtype - ;; 2-syntax-aux.watsup:177.1-177.79 - def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_externtype(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:178.1-178.86 - def {gt : globaltype, ht* : heaptype*, xx* : typevar*} subst_externtype(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) - ;; 2-syntax-aux.watsup:179.1-179.83 - def {ht* : heaptype*, tt : tabletype, xx* : typevar*} subst_externtype(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:180.1-180.77 def {ht* : heaptype*, mt : memtype, xx* : typevar*} subst_externtype(MEM_externtype(mt), xx*{xx}, ht*{ht}) = MEM_externtype($subst_memtype(mt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:179.1-179.83 + def {ht* : heaptype*, tt : tabletype, xx* : typevar*} subst_externtype(TABLE_externtype(tt), xx*{xx}, ht*{ht}) = TABLE_externtype($subst_tabletype(tt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:178.1-178.86 + def {gt : globaltype, ht* : heaptype*, xx* : typevar*} subst_externtype(GLOBAL_externtype(gt), xx*{xx}, ht*{ht}) = GLOBAL_externtype($subst_globaltype(gt, xx*{xx}, ht*{ht})) + ;; 2-syntax-aux.watsup:177.1-177.79 + def {dt : deftype, ht* : heaptype*, xx* : typevar*} subst_externtype(FUNC_externtype(dt), xx*{xx}, ht*{ht}) = FUNC_externtype($subst_deftype(dt, xx*{xx}, ht*{ht})) ;; 2-syntax-aux.watsup:183.1-183.74 def subst_all_reftype : (reftype, heaptype*) -> reftype @@ -25952,10 +26095,10 @@ rec { ;; 2-syntax-aux.watsup:189.1-189.77 def subst_all_deftypes : (deftype*, heaptype*) -> deftype* - ;; 2-syntax-aux.watsup:191.1-191.40 - def {ht* : heaptype*} subst_all_deftypes([], ht*{ht}) = [] ;; 2-syntax-aux.watsup:192.1-192.101 def {dt* : deftype*, dt_1 : deftype, ht* : heaptype*} subst_all_deftypes([dt_1] :: dt*{dt}, ht*{ht}) = [$subst_all_deftype(dt_1, ht*{ht})] :: $subst_all_deftypes(dt*{dt}, ht*{ht}) + ;; 2-syntax-aux.watsup:191.1-191.40 + def {ht* : heaptype*} subst_all_deftypes([], ht*{ht}) = [] } ;; 2-syntax-aux.watsup:197.1-197.65 @@ -25999,13 +26142,13 @@ rec { ;; 2-syntax-aux.watsup:221.1-221.64 def funcsxt : externtype* -> deftype* - ;; 2-syntax-aux.watsup:226.1-226.24 - def funcsxt([]) = [] - ;; 2-syntax-aux.watsup:227.1-227.47 - def {dt : deftype, et* : externtype*} funcsxt([FUNC_externtype(dt)] :: et*{et}) = [dt] :: $funcsxt(et*{et}) ;; 2-syntax-aux.watsup:228.1-228.59 def {et* : externtype*, externtype : externtype} funcsxt([externtype] :: et*{et}) = $funcsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:227.1-227.47 + def {dt : deftype, et* : externtype*} funcsxt([FUNC_externtype(dt)] :: et*{et}) = [dt] :: $funcsxt(et*{et}) + ;; 2-syntax-aux.watsup:226.1-226.24 + def funcsxt([]) = [] } ;; 2-syntax-aux.watsup:222.1-222.66 @@ -26013,13 +26156,13 @@ rec { ;; 2-syntax-aux.watsup:222.1-222.66 def globalsxt : externtype* -> globaltype* - ;; 2-syntax-aux.watsup:230.1-230.26 - def globalsxt([]) = [] - ;; 2-syntax-aux.watsup:231.1-231.53 - def {et* : externtype*, gt : globaltype} globalsxt([GLOBAL_externtype(gt)] :: et*{et}) = [gt] :: $globalsxt(et*{et}) ;; 2-syntax-aux.watsup:232.1-232.63 def {et* : externtype*, externtype : externtype} globalsxt([externtype] :: et*{et}) = $globalsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:231.1-231.53 + def {et* : externtype*, gt : globaltype} globalsxt([GLOBAL_externtype(gt)] :: et*{et}) = [gt] :: $globalsxt(et*{et}) + ;; 2-syntax-aux.watsup:230.1-230.26 + def globalsxt([]) = [] } ;; 2-syntax-aux.watsup:223.1-223.65 @@ -26027,13 +26170,13 @@ rec { ;; 2-syntax-aux.watsup:223.1-223.65 def tablesxt : externtype* -> tabletype* - ;; 2-syntax-aux.watsup:234.1-234.25 - def tablesxt([]) = [] - ;; 2-syntax-aux.watsup:235.1-235.50 - def {et* : externtype*, tt : tabletype} tablesxt([TABLE_externtype(tt)] :: et*{et}) = [tt] :: $tablesxt(et*{et}) ;; 2-syntax-aux.watsup:236.1-236.61 def {et* : externtype*, externtype : externtype} tablesxt([externtype] :: et*{et}) = $tablesxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:235.1-235.50 + def {et* : externtype*, tt : tabletype} tablesxt([TABLE_externtype(tt)] :: et*{et}) = [tt] :: $tablesxt(et*{et}) + ;; 2-syntax-aux.watsup:234.1-234.25 + def tablesxt([]) = [] } ;; 2-syntax-aux.watsup:224.1-224.63 @@ -26041,13 +26184,13 @@ rec { ;; 2-syntax-aux.watsup:224.1-224.63 def memsxt : externtype* -> memtype* - ;; 2-syntax-aux.watsup:238.1-238.23 - def memsxt([]) = [] - ;; 2-syntax-aux.watsup:239.1-239.44 - def {et* : externtype*, mt : memtype} memsxt([MEM_externtype(mt)] :: et*{et}) = [mt] :: $memsxt(et*{et}) ;; 2-syntax-aux.watsup:240.1-240.57 def {et* : externtype*, externtype : externtype} memsxt([externtype] :: et*{et}) = $memsxt(et*{et}) -- otherwise + ;; 2-syntax-aux.watsup:239.1-239.44 + def {et* : externtype*, mt : memtype} memsxt([MEM_externtype(mt)] :: et*{et}) = [mt] :: $memsxt(et*{et}) + ;; 2-syntax-aux.watsup:238.1-238.23 + def memsxt([]) = [] } ;; 2-syntax-aux.watsup:249.1-249.33 @@ -26060,12 +26203,12 @@ def s33_to_u32 : s33 -> u32 ;; 3-numerics.watsup:12.1-12.57 def signed : (N, nat) -> int - ;; 3-numerics.watsup:13.1-13.54 - def {N : N, i : nat} signed(N, i) = (i <: int) - -- if (0 <= (2 ^ (N - 1))) ;; 3-numerics.watsup:14.1-14.60 def {N : N, i : nat} signed(N, i) = ((i - (2 ^ N)) <: int) -- if (((2 ^ (N - 1)) <= i) /\ (i < (2 ^ N))) + ;; 3-numerics.watsup:13.1-13.54 + def {N : N, i : nat} signed(N, i) = (i <: int) + -- if (0 <= (2 ^ (N - 1))) ;; 3-numerics.watsup:16.1-16.63 def invsigned : (N, int) -> nat @@ -26493,45 +26636,45 @@ def inst_reftype : (moduleinst, reftype) -> reftype ;; 5-runtime-aux.watsup:19.1-19.52 def default : valtype -> val? - ;; 5-runtime-aux.watsup:21.1-21.34 - def default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) - ;; 5-runtime-aux.watsup:22.1-22.34 - def default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) - ;; 5-runtime-aux.watsup:23.1-23.34 - def default(F32_valtype) = ?(CONST_val(F32_numtype, 0)) - ;; 5-runtime-aux.watsup:24.1-24.34 - def default(F64_valtype) = ?(CONST_val(F64_numtype, 0)) - ;; 5-runtime-aux.watsup:25.1-25.42 - def {ht : heaptype} default(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) ;; 5-runtime-aux.watsup:26.1-26.31 def {ht : heaptype} default(REF_valtype(`NULL%?`(?()), ht)) = ?() + ;; 5-runtime-aux.watsup:25.1-25.42 + def {ht : heaptype} default(REF_valtype(`NULL%?`(?(())), ht)) = ?(REF.NULL_val(ht)) + ;; 5-runtime-aux.watsup:24.1-24.34 + def default(F64_valtype) = ?(CONST_val(F64_numtype, 0)) + ;; 5-runtime-aux.watsup:23.1-23.34 + def default(F32_valtype) = ?(CONST_val(F32_numtype, 0)) + ;; 5-runtime-aux.watsup:22.1-22.34 + def default(I64_valtype) = ?(CONST_val(I64_numtype, 0)) + ;; 5-runtime-aux.watsup:21.1-21.34 + def default(I32_valtype) = ?(CONST_val(I32_numtype, 0)) ;; 5-runtime-aux.watsup:31.1-31.73 def packval : (storagetype, val) -> fieldval - ;; 5-runtime-aux.watsup:34.1-34.27 - def {t : valtype, val : val} packval($storagetype_valtype(t), val) = $fieldval_val(val) ;; 5-runtime-aux.watsup:35.1-35.70 def {i : nat, pt : packedtype} packval($storagetype_packedtype(pt), CONST_val(I32_numtype, i)) = PACK_fieldval(pt, $wrap(32, $packedsize(pt), i)) + ;; 5-runtime-aux.watsup:34.1-34.27 + def {t : valtype, val : val} packval($storagetype_valtype(t), val) = $fieldval_val(val) ;; 5-runtime-aux.watsup:32.1-32.83 def unpackval : (storagetype, sx?, fieldval) -> val - ;; 5-runtime-aux.watsup:37.1-37.34 - def {t : valtype, val : val} unpackval($storagetype_valtype(t), ?(), $fieldval_val(val)) = val ;; 5-runtime-aux.watsup:38.1-38.79 def {i : nat, pt : packedtype, sx : sx} unpackval($storagetype_packedtype(pt), ?(sx), PACK_fieldval(pt, i)) = CONST_val(I32_numtype, $ext($packedsize(pt), 32, sx, i)) + ;; 5-runtime-aux.watsup:37.1-37.34 + def {t : valtype, val : val} unpackval($storagetype_valtype(t), ?(), $fieldval_val(val)) = val ;; 5-runtime-aux.watsup:43.1-43.62 rec { ;; 5-runtime-aux.watsup:43.1-43.62 def funcsxv : externval* -> funcaddr* - ;; 5-runtime-aux.watsup:48.1-48.24 - def funcsxv([]) = [] - ;; 5-runtime-aux.watsup:49.1-49.47 - def {fa : funcaddr, xv* : externval*} funcsxv([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) ;; 5-runtime-aux.watsup:50.1-50.58 def {externval : externval, xv* : externval*} funcsxv([externval] :: xv*{xv}) = $funcsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:49.1-49.47 + def {fa : funcaddr, xv* : externval*} funcsxv([FUNC_externval(fa)] :: xv*{xv}) = [fa] :: $funcsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:48.1-48.24 + def funcsxv([]) = [] } ;; 5-runtime-aux.watsup:44.1-44.64 @@ -26539,13 +26682,13 @@ rec { ;; 5-runtime-aux.watsup:44.1-44.64 def globalsxv : externval* -> globaladdr* - ;; 5-runtime-aux.watsup:52.1-52.26 - def globalsxv([]) = [] - ;; 5-runtime-aux.watsup:53.1-53.53 - def {ga : globaladdr, xv* : externval*} globalsxv([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) ;; 5-runtime-aux.watsup:54.1-54.62 def {externval : externval, xv* : externval*} globalsxv([externval] :: xv*{xv}) = $globalsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:53.1-53.53 + def {ga : globaladdr, xv* : externval*} globalsxv([GLOBAL_externval(ga)] :: xv*{xv}) = [ga] :: $globalsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:52.1-52.26 + def globalsxv([]) = [] } ;; 5-runtime-aux.watsup:45.1-45.63 @@ -26553,13 +26696,13 @@ rec { ;; 5-runtime-aux.watsup:45.1-45.63 def tablesxv : externval* -> tableaddr* - ;; 5-runtime-aux.watsup:56.1-56.25 - def tablesxv([]) = [] - ;; 5-runtime-aux.watsup:57.1-57.50 - def {ta : tableaddr, xv* : externval*} tablesxv([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) ;; 5-runtime-aux.watsup:58.1-58.60 def {externval : externval, xv* : externval*} tablesxv([externval] :: xv*{xv}) = $tablesxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:57.1-57.50 + def {ta : tableaddr, xv* : externval*} tablesxv([TABLE_externval(ta)] :: xv*{xv}) = [ta] :: $tablesxv(xv*{xv}) + ;; 5-runtime-aux.watsup:56.1-56.25 + def tablesxv([]) = [] } ;; 5-runtime-aux.watsup:46.1-46.61 @@ -26567,13 +26710,13 @@ rec { ;; 5-runtime-aux.watsup:46.1-46.61 def memsxv : externval* -> memaddr* - ;; 5-runtime-aux.watsup:60.1-60.23 - def memsxv([]) = [] - ;; 5-runtime-aux.watsup:61.1-61.44 - def {ma : memaddr, xv* : externval*} memsxv([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) ;; 5-runtime-aux.watsup:62.1-62.56 def {externval : externval, xv* : externval*} memsxv([externval] :: xv*{xv}) = $memsxv(xv*{xv}) -- otherwise + ;; 5-runtime-aux.watsup:61.1-61.44 + def {ma : memaddr, xv* : externval*} memsxv([MEM_externval(ma)] :: xv*{xv}) = [ma] :: $memsxv(xv*{xv}) + ;; 5-runtime-aux.watsup:60.1-60.23 + def memsxv([]) = [] } ;; 5-runtime-aux.watsup:72.1-72.57 @@ -26775,10 +26918,10 @@ rec { ;; 6-typing.watsup:26.1-26.86 def with_locals : (context, localidx*, localtype*) -> context - ;; 6-typing.watsup:28.1-28.34 - def {C : context} with_locals(C, [], []) = C ;; 6-typing.watsup:29.1-29.85 def {C : context, lt* : localtype*, lt_1 : localtype, x* : idx*, x_1 : idx} with_locals(C, [x_1] :: x*{x}, [lt_1] :: lt*{lt}) = $with_locals(C[LOCAL_context[x_1] = lt_1], x*{x}, lt*{lt}) + ;; 6-typing.watsup:28.1-28.34 + def {C : context} with_locals(C, [], []) = C } ;; 6-typing.watsup:33.1-33.65 @@ -26786,11 +26929,11 @@ rec { ;; 6-typing.watsup:33.1-33.65 def clostypes : deftype* -> deftype* - ;; 6-typing.watsup:37.1-37.26 - def clostypes([]) = [] ;; 6-typing.watsup:38.1-38.93 def {dt* : deftype*, dt'* : deftype*, dt_N : deftype} clostypes(dt*{dt} :: [dt_N]) = dt'*{dt'} :: [$subst_all_deftype(dt_N, $heaptype_deftype(dt')*{dt'})] -- if (dt'*{dt'} = $clostypes(dt*{dt})) + ;; 6-typing.watsup:37.1-37.26 + def clostypes([]) = [] } ;; 6-typing.watsup:32.1-32.65 @@ -26813,9 +26956,11 @@ relation Vectype_ok: `%|-%:OK`(context, vectype) ;; 6-typing.watsup:49.1-49.72 relation Heaptype_ok: `%|-%:OK`(context, heaptype) - ;; 6-typing.watsup:60.1-61.24 - rule abs {C : context, absheaptype : absheaptype}: - `%|-%:OK`(C, $heaptype_absheaptype(absheaptype)) + ;; 6-typing.watsup:67.1-69.22 + rule rec {C : context, i : nat, st : subtype}: + `%|-%:OK`(C, REC_heaptype(i)) + -- if (i < |C.REC_context|) + -- if (C.REC_context[i] = st) ;; 6-typing.watsup:63.1-65.23 rule typeidx {C : context, dt : deftype, x : idx}: @@ -26823,11 +26968,9 @@ relation Heaptype_ok: `%|-%:OK`(context, heaptype) -- if (x < |C.TYPE_context|) -- if (C.TYPE_context[x] = dt) - ;; 6-typing.watsup:67.1-69.22 - rule rec {C : context, i : nat, st : subtype}: - `%|-%:OK`(C, REC_heaptype(i)) - -- if (i < |C.REC_context|) - -- if (C.REC_context[i] = st) + ;; 6-typing.watsup:60.1-61.24 + rule abs {C : context, absheaptype : absheaptype}: + `%|-%:OK`(C, $heaptype_absheaptype(absheaptype)) ;; 6-typing.watsup:50.1-50.71 relation Reftype_ok: `%|-%:OK`(context, reftype) @@ -26838,24 +26981,24 @@ relation Reftype_ok: `%|-%:OK`(context, reftype) ;; 6-typing.watsup:51.1-51.71 relation Valtype_ok: `%|-%:OK`(context, valtype) - ;; 6-typing.watsup:75.1-77.35 - rule num {C : context, numtype : numtype}: - `%|-%:OK`(C, $valtype_numtype(numtype)) - -- Numtype_ok: `%|-%:OK`(C, numtype) - - ;; 6-typing.watsup:79.1-81.35 - rule vec {C : context, vectype : vectype}: - `%|-%:OK`(C, $valtype_vectype(vectype)) - -- Vectype_ok: `%|-%:OK`(C, vectype) + ;; 6-typing.watsup:87.1-88.16 + rule bot {C : context}: + `%|-%:OK`(C, BOT_valtype) ;; 6-typing.watsup:83.1-85.35 rule ref {C : context, reftype : reftype}: `%|-%:OK`(C, $valtype_reftype(reftype)) -- Reftype_ok: `%|-%:OK`(C, reftype) - ;; 6-typing.watsup:87.1-88.16 - rule bot {C : context}: - `%|-%:OK`(C, BOT_valtype) + ;; 6-typing.watsup:79.1-81.35 + rule vec {C : context, vectype : vectype}: + `%|-%:OK`(C, $valtype_vectype(vectype)) + -- Vectype_ok: `%|-%:OK`(C, vectype) + + ;; 6-typing.watsup:75.1-77.35 + rule num {C : context, numtype : numtype}: + `%|-%:OK`(C, $valtype_numtype(numtype)) + -- Numtype_ok: `%|-%:OK`(C, numtype) ;; 6-typing.watsup:93.1-93.74 relation Resulttype_ok: `%|-%:OK`(context, resulttype) @@ -26891,16 +27034,16 @@ relation Packedtype_ok: `%|-%:OK`(context, packedtype) ;; 6-typing.watsup:114.1-114.77 relation Storagetype_ok: `%|-%:OK`(context, storagetype) - ;; 6-typing.watsup:131.1-133.35 - rule val {C : context, valtype : valtype}: - `%|-%:OK`(C, $storagetype_valtype(valtype)) - -- Valtype_ok: `%|-%:OK`(C, valtype) - ;; 6-typing.watsup:135.1-137.41 rule packed {C : context, packedtype : packedtype}: `%|-%:OK`(C, $storagetype_packedtype(packedtype)) -- Packedtype_ok: `%|-%:OK`(C, packedtype) + ;; 6-typing.watsup:131.1-133.35 + rule val {C : context, valtype : valtype}: + `%|-%:OK`(C, $storagetype_valtype(valtype)) + -- Valtype_ok: `%|-%:OK`(C, valtype) + ;; 6-typing.watsup:113.1-113.75 relation Fieldtype_ok: `%|-%:OK`(context, fieldtype) ;; 6-typing.watsup:139.1-141.34 @@ -26918,20 +27061,20 @@ relation Functype_ok: `%|-%:OK`(context, functype) ;; 6-typing.watsup:115.1-115.74 relation Comptype_ok: `%|-%:OK`(context, comptype) - ;; 6-typing.watsup:144.1-146.35 - rule struct {C : context, yt* : fieldtype*}: - `%|-%:OK`(C, STRUCT_comptype(yt*{yt})) - -- (Fieldtype_ok: `%|-%:OK`(C, yt))*{yt} + ;; 6-typing.watsup:152.1-154.31 + rule func {C : context, ft : functype}: + `%|-%:OK`(C, FUNC_comptype(ft)) + -- Functype_ok: `%|-%:OK`(C, ft) ;; 6-typing.watsup:148.1-150.32 rule array {C : context, yt : fieldtype}: `%|-%:OK`(C, ARRAY_comptype(yt)) -- Fieldtype_ok: `%|-%:OK`(C, yt) - ;; 6-typing.watsup:152.1-154.31 - rule func {C : context, ft : functype}: - `%|-%:OK`(C, FUNC_comptype(ft)) - -- Functype_ok: `%|-%:OK`(C, ft) + ;; 6-typing.watsup:144.1-146.35 + rule struct {C : context, yt* : fieldtype*}: + `%|-%:OK`(C, STRUCT_comptype(yt*{yt})) + -- (Fieldtype_ok: `%|-%:OK`(C, yt))*{yt} ;; 6-typing.watsup:391.1-391.91 relation Packedtype_sub: `%|-%<:%`(context, packedtype, packedtype) @@ -26950,116 +27093,116 @@ rec { ;; 6-typing.watsup:125.1-125.75 relation Deftype_sub: `%|-%<:%`(context, deftype, deftype) - ;; 6-typing.watsup:434.1-436.58 - rule refl {C : context, deftype_1 : deftype, deftype_2 : deftype}: - `%|-%<:%`(C, deftype_1, deftype_2) - -- if ($clostype(C, deftype_1) = $clostype(C, deftype_2)) - ;; 6-typing.watsup:438.1-441.40 rule super {C : context, ct : comptype, deftype_1 : deftype, deftype_2 : deftype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*}: `%|-%<:%`(C, deftype_1, deftype_2) -- if ($unrolldt(deftype_1) = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) -- Heaptype_sub: `%|-%<:%`(C, ht, $heaptype_deftype(deftype_2)) + ;; 6-typing.watsup:434.1-436.58 + rule refl {C : context, deftype_1 : deftype, deftype_2 : deftype}: + `%|-%<:%`(C, deftype_1, deftype_2) + -- if ($clostype(C, deftype_1) = $clostype(C, deftype_2)) + ;; 6-typing.watsup:271.1-271.79 relation Heaptype_sub: `%|-%<:%`(context, heaptype, heaptype) - ;; 6-typing.watsup:282.1-283.28 - rule refl {C : context, heaptype : heaptype}: - `%|-%<:%`(C, heaptype, heaptype) + ;; 6-typing.watsup:343.1-344.23 + rule bot {C : context, heaptype : heaptype}: + `%|-%<:%`(C, BOT_heaptype, heaptype) - ;; 6-typing.watsup:285.1-289.48 - rule trans {C : context, heaptype' : heaptype, heaptype_1 : heaptype, heaptype_2 : heaptype}: - `%|-%<:%`(C, heaptype_1, heaptype_2) - -- Heaptype_ok: `%|-%:OK`(C, heaptype') - -- Heaptype_sub: `%|-%<:%`(C, heaptype_1, heaptype') - -- Heaptype_sub: `%|-%<:%`(C, heaptype', heaptype_2) + ;; 6-typing.watsup:339.1-341.43 + rule noextern {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NOEXTERN_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, EXTERN_heaptype) - ;; 6-typing.watsup:291.1-292.17 - rule eq-any {C : context}: - `%|-%<:%`(C, EQ_heaptype, ANY_heaptype) + ;; 6-typing.watsup:335.1-337.41 + rule nofunc {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NOFUNC_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, FUNC_heaptype) - ;; 6-typing.watsup:294.1-295.17 - rule i31-eq {C : context}: - `%|-%<:%`(C, I31_heaptype, EQ_heaptype) + ;; 6-typing.watsup:331.1-333.40 + rule none {C : context, heaptype : heaptype}: + `%|-%<:%`(C, NONE_heaptype, heaptype) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, ANY_heaptype) - ;; 6-typing.watsup:297.1-298.20 - rule struct-eq {C : context}: - `%|-%<:%`(C, STRUCT_heaptype, EQ_heaptype) + ;; 6-typing.watsup:327.1-329.48 + rule rec {C : context, ct : comptype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*, i : nat}: + `%|-%<:%`(C, REC_heaptype(i), ht) + -- if (i < |C.REC_context|) + -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) - ;; 6-typing.watsup:300.1-301.19 - rule array-eq {C : context}: - `%|-%<:%`(C, ARRAY_heaptype, EQ_heaptype) + ;; 6-typing.watsup:323.1-325.52 + rule typeidx-r {C : context, heaptype : heaptype, typeidx : typeidx}: + `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) + -- if (typeidx < |C.TYPE_context|) + -- Heaptype_sub: `%|-%<:%`(C, heaptype, $heaptype_deftype(C.TYPE_context[typeidx])) - ;; 6-typing.watsup:303.1-305.35 - rule struct {C : context, deftype : deftype, yt* : fieldtype*}: - `%|-%<:%`(C, $heaptype_deftype(deftype), STRUCT_heaptype) - -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) + ;; 6-typing.watsup:319.1-321.52 + rule typeidx-l {C : context, heaptype : heaptype, typeidx : typeidx}: + `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) + -- if (typeidx < |C.TYPE_context|) + -- Heaptype_sub: `%|-%<:%`(C, $heaptype_deftype(C.TYPE_context[typeidx]), heaptype) - ;; 6-typing.watsup:307.1-309.33 - rule array {C : context, deftype : deftype, yt : fieldtype}: - `%|-%<:%`(C, $heaptype_deftype(deftype), ARRAY_heaptype) - -- Expand: `%~~%`(deftype, ARRAY_comptype(yt)) + ;; 6-typing.watsup:315.1-317.46 + rule def {C : context, deftype_1 : deftype, deftype_2 : deftype}: + `%|-%<:%`(C, $heaptype_deftype(deftype_1), $heaptype_deftype(deftype_2)) + -- Deftype_sub: `%|-%<:%`(C, deftype_1, deftype_2) ;; 6-typing.watsup:311.1-313.32 rule func {C : context, deftype : deftype, ft : functype}: `%|-%<:%`(C, $heaptype_deftype(deftype), FUNC_heaptype) -- Expand: `%~~%`(deftype, FUNC_comptype(ft)) - ;; 6-typing.watsup:315.1-317.46 - rule def {C : context, deftype_1 : deftype, deftype_2 : deftype}: - `%|-%<:%`(C, $heaptype_deftype(deftype_1), $heaptype_deftype(deftype_2)) - -- Deftype_sub: `%|-%<:%`(C, deftype_1, deftype_2) + ;; 6-typing.watsup:307.1-309.33 + rule array {C : context, deftype : deftype, yt : fieldtype}: + `%|-%<:%`(C, $heaptype_deftype(deftype), ARRAY_heaptype) + -- Expand: `%~~%`(deftype, ARRAY_comptype(yt)) - ;; 6-typing.watsup:319.1-321.52 - rule typeidx-l {C : context, heaptype : heaptype, typeidx : typeidx}: - `%|-%<:%`(C, _IDX_heaptype(typeidx), heaptype) - -- if (typeidx < |C.TYPE_context|) - -- Heaptype_sub: `%|-%<:%`(C, $heaptype_deftype(C.TYPE_context[typeidx]), heaptype) + ;; 6-typing.watsup:303.1-305.35 + rule struct {C : context, deftype : deftype, yt* : fieldtype*}: + `%|-%<:%`(C, $heaptype_deftype(deftype), STRUCT_heaptype) + -- Expand: `%~~%`(deftype, STRUCT_comptype(yt*{yt})) - ;; 6-typing.watsup:323.1-325.52 - rule typeidx-r {C : context, heaptype : heaptype, typeidx : typeidx}: - `%|-%<:%`(C, heaptype, _IDX_heaptype(typeidx)) - -- if (typeidx < |C.TYPE_context|) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, $heaptype_deftype(C.TYPE_context[typeidx])) + ;; 6-typing.watsup:300.1-301.19 + rule array-eq {C : context}: + `%|-%<:%`(C, ARRAY_heaptype, EQ_heaptype) - ;; 6-typing.watsup:327.1-329.48 - rule rec {C : context, ct : comptype, fin : fin, ht : heaptype, ht_1* : heaptype*, ht_2* : heaptype*, i : nat}: - `%|-%<:%`(C, REC_heaptype(i), ht) - -- if (i < |C.REC_context|) - -- if (C.REC_context[i] = SUBD_subtype(fin, ht_1*{ht_1} :: [ht] :: ht_2*{ht_2}, ct)) + ;; 6-typing.watsup:297.1-298.20 + rule struct-eq {C : context}: + `%|-%<:%`(C, STRUCT_heaptype, EQ_heaptype) - ;; 6-typing.watsup:331.1-333.40 - rule none {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NONE_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, ANY_heaptype) + ;; 6-typing.watsup:294.1-295.17 + rule i31-eq {C : context}: + `%|-%<:%`(C, I31_heaptype, EQ_heaptype) - ;; 6-typing.watsup:335.1-337.41 - rule nofunc {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NOFUNC_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, FUNC_heaptype) + ;; 6-typing.watsup:291.1-292.17 + rule eq-any {C : context}: + `%|-%<:%`(C, EQ_heaptype, ANY_heaptype) - ;; 6-typing.watsup:339.1-341.43 - rule noextern {C : context, heaptype : heaptype}: - `%|-%<:%`(C, NOEXTERN_heaptype, heaptype) - -- Heaptype_sub: `%|-%<:%`(C, heaptype, EXTERN_heaptype) + ;; 6-typing.watsup:285.1-289.48 + rule trans {C : context, heaptype' : heaptype, heaptype_1 : heaptype, heaptype_2 : heaptype}: + `%|-%<:%`(C, heaptype_1, heaptype_2) + -- Heaptype_ok: `%|-%:OK`(C, heaptype') + -- Heaptype_sub: `%|-%<:%`(C, heaptype_1, heaptype') + -- Heaptype_sub: `%|-%<:%`(C, heaptype', heaptype_2) - ;; 6-typing.watsup:343.1-344.23 - rule bot {C : context, heaptype : heaptype}: - `%|-%<:%`(C, BOT_heaptype, heaptype) + ;; 6-typing.watsup:282.1-283.28 + rule refl {C : context, heaptype : heaptype}: + `%|-%<:%`(C, heaptype, heaptype) } ;; 6-typing.watsup:272.1-272.78 relation Reftype_sub: `%|-%<:%`(context, reftype, reftype) - ;; 6-typing.watsup:347.1-349.37 - rule nonnull {C : context, ht_1 : heaptype, ht_2 : heaptype}: - `%|-%<:%`(C, REF_reftype(`NULL%?`(?()), ht_1), REF_reftype(`NULL%?`(?()), ht_2)) - -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) - ;; 6-typing.watsup:351.1-353.37 rule null {C : context, ht_1 : heaptype, ht_2 : heaptype, w0 : ()?}: `%|-%<:%`(C, REF_reftype(`NULL%?`(w0), ht_1), REF_reftype(`NULL%?`(?(())), ht_2)) -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) + ;; 6-typing.watsup:347.1-349.37 + rule nonnull {C : context, ht_1 : heaptype, ht_2 : heaptype}: + `%|-%<:%`(C, REF_reftype(`NULL%?`(?()), ht_1), REF_reftype(`NULL%?`(?()), ht_2)) + -- Heaptype_sub: `%|-%<:%`(C, ht_1, ht_2) + ;; 6-typing.watsup:270.1-270.78 relation Vectype_sub: `%|-%<:%`(context, vectype, vectype) ;; 6-typing.watsup:278.1-279.26 @@ -27068,50 +27211,50 @@ relation Vectype_sub: `%|-%<:%`(context, vectype, vectype) ;; 6-typing.watsup:273.1-273.78 relation Valtype_sub: `%|-%<:%`(context, valtype, valtype) - ;; 6-typing.watsup:356.1-358.46 - rule num {C : context, numtype_1 : numtype, numtype_2 : numtype}: - `%|-%<:%`(C, $valtype_numtype(numtype_1), $valtype_numtype(numtype_2)) - -- Numtype_sub: `%|-%<:%`(C, numtype_1, numtype_2) - - ;; 6-typing.watsup:360.1-362.46 - rule vec {C : context, vectype_1 : vectype, vectype_2 : vectype}: - `%|-%<:%`(C, $valtype_vectype(vectype_1), $valtype_vectype(vectype_2)) - -- Vectype_sub: `%|-%<:%`(C, vectype_1, vectype_2) + ;; 6-typing.watsup:368.1-369.22 + rule bot {C : context, valtype : valtype}: + `%|-%<:%`(C, BOT_valtype, valtype) ;; 6-typing.watsup:364.1-366.46 rule ref {C : context, reftype_1 : reftype, reftype_2 : reftype}: `%|-%<:%`(C, $valtype_reftype(reftype_1), $valtype_reftype(reftype_2)) -- Reftype_sub: `%|-%<:%`(C, reftype_1, reftype_2) - ;; 6-typing.watsup:368.1-369.22 - rule bot {C : context, valtype : valtype}: - `%|-%<:%`(C, BOT_valtype, valtype) + ;; 6-typing.watsup:360.1-362.46 + rule vec {C : context, vectype_1 : vectype, vectype_2 : vectype}: + `%|-%<:%`(C, $valtype_vectype(vectype_1), $valtype_vectype(vectype_2)) + -- Vectype_sub: `%|-%<:%`(C, vectype_1, vectype_2) + + ;; 6-typing.watsup:356.1-358.46 + rule num {C : context, numtype_1 : numtype, numtype_2 : numtype}: + `%|-%<:%`(C, $valtype_numtype(numtype_1), $valtype_numtype(numtype_2)) + -- Numtype_sub: `%|-%<:%`(C, numtype_1, numtype_2) ;; 6-typing.watsup:392.1-392.92 relation Storagetype_sub: `%|-%<:%`(context, storagetype, storagetype) - ;; 6-typing.watsup:402.1-404.46 - rule val {C : context, valtype_1 : valtype, valtype_2 : valtype}: - `%|-%<:%`(C, $storagetype_valtype(valtype_1), $storagetype_valtype(valtype_2)) - -- Valtype_sub: `%|-%<:%`(C, valtype_1, valtype_2) - ;; 6-typing.watsup:406.1-408.55 rule packed {C : context, packedtype_1 : packedtype, packedtype_2 : packedtype}: `%|-%<:%`(C, $storagetype_packedtype(packedtype_1), $storagetype_packedtype(packedtype_2)) -- Packedtype_sub: `%|-%<:%`(C, packedtype_1, packedtype_2) + ;; 6-typing.watsup:402.1-404.46 + rule val {C : context, valtype_1 : valtype, valtype_2 : valtype}: + `%|-%<:%`(C, $storagetype_valtype(valtype_1), $storagetype_valtype(valtype_2)) + -- Valtype_sub: `%|-%<:%`(C, valtype_1, valtype_2) + ;; 6-typing.watsup:393.1-393.90 relation Fieldtype_sub: `%|-%<:%`(context, fieldtype, fieldtype) - ;; 6-typing.watsup:411.1-413.40 - rule const {C : context, zt_1 : storagetype, zt_2 : storagetype}: - `%|-%<:%`(C, `%%`(`MUT%?`(?()), zt_1), `%%`(`MUT%?`(?()), zt_2)) - -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) - ;; 6-typing.watsup:415.1-418.40 rule var {C : context, zt_1 : storagetype, zt_2 : storagetype}: `%|-%<:%`(C, `%%`(`MUT%?`(?(())), zt_1), `%%`(`MUT%?`(?(())), zt_2)) -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) + ;; 6-typing.watsup:411.1-413.40 + rule const {C : context, zt_1 : storagetype, zt_2 : storagetype}: + `%|-%<:%`(C, `%%`(`MUT%?`(?()), zt_1), `%%`(`MUT%?`(?()), zt_2)) + -- Storagetype_sub: `%|-%<:%`(C, zt_1, zt_2) + ;; 6-typing.watsup:395.1-395.89 relation Functype_sub: `%|-%<:%`(context, functype, functype) ;; 6-typing.watsup:458.1-459.16 @@ -27120,21 +27263,21 @@ relation Functype_sub: `%|-%<:%`(context, functype, functype) ;; 6-typing.watsup:124.1-124.76 relation Comptype_sub: `%|-%<:%`(context, comptype, comptype) - ;; 6-typing.watsup:421.1-423.41 - rule struct {C : context, yt'_1 : fieldtype, yt_1* : fieldtype*, yt_2* : fieldtype*}: - `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) - -- if (|yt_1*{yt_1}| = |yt_2*{yt_2}|) - -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} + ;; 6-typing.watsup:429.1-431.37 + rule func {C : context, ft_1 : functype, ft_2 : functype}: + `%|-%<:%`(C, FUNC_comptype(ft_1), FUNC_comptype(ft_2)) + -- Functype_sub: `%|-%<:%`(C, ft_1, ft_2) ;; 6-typing.watsup:425.1-427.38 rule array {C : context, yt_1 : fieldtype, yt_2 : fieldtype}: `%|-%<:%`(C, ARRAY_comptype(yt_1), ARRAY_comptype(yt_2)) -- Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2) - ;; 6-typing.watsup:429.1-431.37 - rule func {C : context, ft_1 : functype, ft_2 : functype}: - `%|-%<:%`(C, FUNC_comptype(ft_1), FUNC_comptype(ft_2)) - -- Functype_sub: `%|-%<:%`(C, ft_1, ft_2) + ;; 6-typing.watsup:421.1-423.41 + rule struct {C : context, yt'_1 : fieldtype, yt_1* : fieldtype*, yt_2* : fieldtype*}: + `%|-%<:%`(C, STRUCT_comptype(yt_1*{yt_1} :: [yt'_1]), STRUCT_comptype(yt_2*{yt_2})) + -- if (|yt_1*{yt_1}| = |yt_2*{yt_2}|) + -- (Fieldtype_sub: `%|-%<:%`(C, yt_1, yt_2))*{yt_1 yt_2} ;; 6-typing.watsup:117.1-117.73 relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) @@ -27152,21 +27295,21 @@ relation Subtype_ok: `%|-%:%`(context, subtype, oktypeidx) ;; 6-typing.watsup:165.1-165.65 def before : (heaptype, typeidx, nat) -> bool - ;; 6-typing.watsup:166.1-166.34 - def {deftype : deftype, i : nat, x : idx} before($heaptype_deftype(deftype), x, i) = true - ;; 6-typing.watsup:167.1-167.46 - def {i : nat, typeidx : typeidx, x : idx} before(_IDX_heaptype(typeidx), x, i) = (typeidx < x) ;; 6-typing.watsup:168.1-168.33 def {i : nat, j : nat, x : idx} before(REC_heaptype(j), x, i) = (j < i) + ;; 6-typing.watsup:167.1-167.46 + def {i : nat, typeidx : typeidx, x : idx} before(_IDX_heaptype(typeidx), x, i) = (typeidx < x) + ;; 6-typing.watsup:166.1-166.34 + def {deftype : deftype, i : nat, x : idx} before($heaptype_deftype(deftype), x, i) = true ;; 6-typing.watsup:170.1-170.69 def unrollht : (context, heaptype) -> subtype - ;; 6-typing.watsup:171.1-171.47 - def {C : context, deftype : deftype} unrollht(C, $heaptype_deftype(deftype)) = $unrolldt(deftype) - ;; 6-typing.watsup:172.1-172.60 - def {C : context, typeidx : typeidx} unrollht(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx]) ;; 6-typing.watsup:173.1-173.35 def {C : context, i : nat} unrollht(C, REC_heaptype(i)) = C.REC_context[i] + ;; 6-typing.watsup:172.1-172.60 + def {C : context, typeidx : typeidx} unrollht(C, _IDX_heaptype(typeidx)) = $unrolldt(C.TYPE_context[typeidx]) + ;; 6-typing.watsup:171.1-171.47 + def {C : context, deftype : deftype} unrollht(C, $heaptype_deftype(deftype)) = $unrolldt(deftype) ;; 6-typing.watsup:119.1-119.76 relation Subtype_ok2: `%|-%:%`(context, subtype, oktypeidxnat) @@ -27186,15 +27329,15 @@ rec { ;; 6-typing.watsup:120.1-120.76 relation Rectype_ok2: `%|-%:%`(context, rectype, oktypeidxnat) - ;; 6-typing.watsup:196.1-197.24 - rule empty {C : context, i : nat, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) - ;; 6-typing.watsup:199.1-202.50 rule cons {C : context, i : nat, st* : subtype*, st_1 : subtype, x : idx}: `%|-%:%`(C, REC_rectype([st_1] :: st*{st}), OK_oktypeidxnat(x, i)) -- Subtype_ok2: `%|-%:%`(C, st_1, OK_oktypeidxnat(x, i)) -- Rectype_ok2: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidxnat((x + 1), (i + 1))) + + ;; 6-typing.watsup:196.1-197.24 + rule empty {C : context, i : nat, x : idx}: + `%|-%:%`(C, REC_rectype([]), OK_oktypeidxnat(x, i)) } ;; 6-typing.watsup:118.1-118.74 @@ -27202,9 +27345,10 @@ rec { ;; 6-typing.watsup:118.1-118.74 relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) - ;; 6-typing.watsup:184.1-185.23 - rule empty {C : context, x : idx}: - `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) + ;; 6-typing.watsup:192.1-194.49 + rule rec2 {C : context, st* : subtype*, x : idx}: + `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) + -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) ;; 6-typing.watsup:187.1-190.43 rule cons {C : context, st* : subtype*, st_1 : subtype, x : idx}: @@ -27212,10 +27356,9 @@ relation Rectype_ok: `%|-%:%`(context, rectype, oktypeidx) -- Subtype_ok: `%|-%:%`(C, st_1, OK_oktypeidx(x)) -- Rectype_ok: `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x + 1)) - ;; 6-typing.watsup:192.1-194.49 - rule rec2 {C : context, st* : subtype*, x : idx}: - `%|-%:%`(C, REC_rectype(st*{st}), OK_oktypeidx(x)) - -- Rectype_ok2: `%|-%:%`(C ++ {TYPE [], REC st*{st}, FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, REC_rectype(st*{st}), OK_oktypeidxnat(x, 0)) + ;; 6-typing.watsup:184.1-185.23 + rule empty {C : context, x : idx}: + `%|-%:%`(C, REC_rectype([]), OK_oktypeidx(x)) } ;; 6-typing.watsup:121.1-121.73 @@ -27258,26 +27401,26 @@ relation Memtype_ok: `%|-%:OK`(context, memtype) ;; 6-typing.watsup:218.1-218.74 relation Externtype_ok: `%|-%:OK`(context, externtype) - ;; 6-typing.watsup:244.1-247.27 - rule func {C : context, dt : deftype, ft : functype}: - `%|-%:OK`(C, FUNC_externtype(dt)) - -- Deftype_ok: `%|-%:OK`(C, dt) - -- Expand: `%~~%`(dt, FUNC_comptype(ft)) - - ;; 6-typing.watsup:249.1-251.33 - rule global {C : context, gt : globaltype}: - `%|-%:OK`(C, GLOBAL_externtype(gt)) - -- Globaltype_ok: `%|-%:OK`(C, gt) + ;; 6-typing.watsup:257.1-259.30 + rule mem {C : context, mt : memtype}: + `%|-%:OK`(C, MEM_externtype(mt)) + -- Memtype_ok: `%|-%:OK`(C, mt) ;; 6-typing.watsup:253.1-255.32 rule table {C : context, tt : tabletype}: `%|-%:OK`(C, TABLE_externtype(tt)) -- Tabletype_ok: `%|-%:OK`(C, tt) - ;; 6-typing.watsup:257.1-259.30 - rule mem {C : context, mt : memtype}: - `%|-%:OK`(C, MEM_externtype(mt)) - -- Memtype_ok: `%|-%:OK`(C, mt) + ;; 6-typing.watsup:249.1-251.33 + rule global {C : context, gt : globaltype}: + `%|-%:OK`(C, GLOBAL_externtype(gt)) + -- Globaltype_ok: `%|-%:OK`(C, gt) + + ;; 6-typing.watsup:244.1-247.27 + rule func {C : context, dt : deftype, ft : functype}: + `%|-%:OK`(C, FUNC_externtype(dt)) + -- Deftype_ok: `%|-%:OK`(C, dt) + -- Expand: `%~~%`(dt, FUNC_comptype(ft)) ;; 6-typing.watsup:374.1-374.81 relation Resulttype_sub: `%|-%*<:%*`(context, valtype*, valtype*) @@ -27309,17 +27452,17 @@ relation Limits_sub: `%|-%<:%`(context, limits, limits) ;; 6-typing.watsup:447.1-447.83 relation Globaltype_sub: `%|-%<:%`(context, globaltype, globaltype) - ;; 6-typing.watsup:461.1-463.34 - rule const {C : context, t_1 : valtype, t_2 : valtype}: - `%|-%<:%`(C, `%%`(`MUT%?`(?()), t_1), `%%`(`MUT%?`(?()), t_2)) - -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) - ;; 6-typing.watsup:465.1-468.34 rule var {C : context, t_1 : valtype, t_2 : valtype}: `%|-%<:%`(C, `%%`(`MUT%?`(?(())), t_1), `%%`(`MUT%?`(?(())), t_2)) -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) -- Valtype_sub: `%|-%<:%`(C, t_2, t_1) + ;; 6-typing.watsup:461.1-463.34 + rule const {C : context, t_1 : valtype, t_2 : valtype}: + `%|-%<:%`(C, `%%`(`MUT%?`(?()), t_1), `%%`(`MUT%?`(?()), t_2)) + -- Valtype_sub: `%|-%<:%`(C, t_1, t_2) + ;; 6-typing.watsup:448.1-448.82 relation Tabletype_sub: `%|-%<:%`(context, tabletype, tabletype) ;; 6-typing.watsup:470.1-474.36 @@ -27338,339 +27481,251 @@ relation Memtype_sub: `%|-%<:%`(context, memtype, memtype) ;; 6-typing.watsup:450.1-450.83 relation Externtype_sub: `%|-%<:%`(context, externtype, externtype) - ;; 6-typing.watsup:481.1-483.36 - rule func {C : context, dt_1 : deftype, dt_2 : deftype}: - `%|-%<:%`(C, FUNC_externtype(dt_1), FUNC_externtype(dt_2)) - -- Deftype_sub: `%|-%<:%`(C, dt_1, dt_2) - - ;; 6-typing.watsup:485.1-487.39 - rule global {C : context, gt_1 : globaltype, gt_2 : globaltype}: - `%|-%<:%`(C, GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) - -- Globaltype_sub: `%|-%<:%`(C, gt_1, gt_2) + ;; 6-typing.watsup:493.1-495.36 + rule mem {C : context, mt_1 : memtype, mt_2 : memtype}: + `%|-%<:%`(C, MEM_externtype(mt_1), MEM_externtype(mt_2)) + -- Memtype_sub: `%|-%<:%`(C, mt_1, mt_2) ;; 6-typing.watsup:489.1-491.38 rule table {C : context, tt_1 : tabletype, tt_2 : tabletype}: `%|-%<:%`(C, TABLE_externtype(tt_1), TABLE_externtype(tt_2)) -- Tabletype_sub: `%|-%<:%`(C, tt_1, tt_2) - ;; 6-typing.watsup:493.1-495.36 - rule mem {C : context, mt_1 : memtype, mt_2 : memtype}: - `%|-%<:%`(C, MEM_externtype(mt_1), MEM_externtype(mt_2)) - -- Memtype_sub: `%|-%<:%`(C, mt_1, mt_2) + ;; 6-typing.watsup:485.1-487.39 + rule global {C : context, gt_1 : globaltype, gt_2 : globaltype}: + `%|-%<:%`(C, GLOBAL_externtype(gt_1), GLOBAL_externtype(gt_2)) + -- Globaltype_sub: `%|-%<:%`(C, gt_1, gt_2) + + ;; 6-typing.watsup:481.1-483.36 + rule func {C : context, dt_1 : deftype, dt_2 : deftype}: + `%|-%<:%`(C, FUNC_externtype(dt_1), FUNC_externtype(dt_2)) + -- Deftype_sub: `%|-%<:%`(C, dt_1, dt_2) ;; 6-typing.watsup:565.1-565.76 relation Blocktype_ok: `%|-%:%`(context, blocktype, functype) - ;; 6-typing.watsup:567.1-568.32 - rule void {C : context}: - `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) - - ;; 6-typing.watsup:570.1-571.28 - rule result {C : context, t : valtype}: - `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`([], [t])) - ;; 6-typing.watsup:573.1-575.34 rule typeidx {C : context, ft : functype, x : idx}: `%|-%:%`(C, _IDX_blocktype(x), ft) -- if (x < |C.TYPE_context|) -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(ft)) + ;; 6-typing.watsup:570.1-571.28 + rule result {C : context, t : valtype}: + `%|-%:%`(C, _RESULT_blocktype(?(t)), `%->%`([], [t])) + + ;; 6-typing.watsup:567.1-568.32 + rule void {C : context}: + `%|-%:%`(C, _RESULT_blocktype(?()), `%->%`([], [])) + ;; 6-typing.watsup:503.1-505.74 rec { ;; 6-typing.watsup:503.1-503.67 relation Instr_ok: `%|-%:%`(context, instr, functype) - ;; 6-typing.watsup:544.1-545.34 - rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) - - ;; 6-typing.watsup:547.1-548.24 - rule nop {C : context}: - `%|-%:%`(C, NOP_instr, `%->%`([], [])) - - ;; 6-typing.watsup:550.1-551.23 - rule drop {C : context, t : valtype}: - `%|-%:%`(C, DROP_instr, `%->%`([t], [])) - - ;; 6-typing.watsup:554.1-555.31 - rule select-expl {C : context, t : valtype}: - `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) - - ;; 6-typing.watsup:557.1-560.37 - rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: - `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) - -- Valtype_sub: `%|-%<:%`(C, t, t') - -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) + ;; 6-typing.watsup:951.1-956.29 + rule store {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, x : idx, o0 : nat, o1? : nat?}: + `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype $valtype_numtype(nt)], [])) + -- if (x < |C.MEM_context|) + -- if ((n?{n} = ?()) <=> (o1?{o1} = ?())) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- (if ($size($valtype_numtype(nt)) = ?(o1)))?{o1} + -- if (C.MEM_context[x] = mt) + -- if ((2 ^ n_A) <= (o0 / 8)) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} + -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) - ;; 6-typing.watsup:578.1-581.61 - rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:944.1-949.29 + rule load {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, x : idx, o0 : nat, o1? : nat?}: + `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [$valtype_numtype(nt)])) + -- if (x < |C.MEM_context|) + -- if ((n?{n} = ?()) <=> (o1?{o1} = ?())) + -- if ((n?{n} = ?()) <=> (sx?{sx} = ?())) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- (if ($size($valtype_numtype(nt)) = ?(o1)))?{o1} + -- if (C.MEM_context[x] = mt) + -- if ((2 ^ n_A) <= (o0 / 8)) + -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} + -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) - ;; 6-typing.watsup:583.1-586.61 - rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:940.1-942.23 + rule data.drop {C : context, x : idx}: + `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) + -- if (x < |C.DATA_context|) + -- if (C.DATA_context[x] = OK) - ;; 6-typing.watsup:588.1-592.65 - rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: - `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) - -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) + ;; 6-typing.watsup:935.1-938.23 + rule memory.init {C : context, mt : memtype, x : idx, y : idx}: + `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (x < |C.MEM_context|) + -- if (y < |C.DATA_context|) + -- if (C.MEM_context[x] = mt) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:597.1-599.24 - rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (l < |C.LABEL_context|) - -- if (C.LABEL_context[l] = t*{t}) + ;; 6-typing.watsup:930.1-933.26 + rule memory.copy {C : context, mt_1 : memtype, mt_2 : memtype, x_1 : idx, x_2 : idx}: + `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (x_1 < |C.MEM_context|) + -- if (x_2 < |C.MEM_context|) + -- if (C.MEM_context[x_1] = mt_1) + -- if (C.MEM_context[x_2] = mt_2) - ;; 6-typing.watsup:601.1-603.24 - rule br_if {C : context, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) - -- if (l < |C.LABEL_context|) - -- if (C.LABEL_context[l] = t*{t}) + ;; 6-typing.watsup:926.1-928.22 + rule memory.fill {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (x < |C.MEM_context|) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:605.1-608.44 - rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- (if (l < |C.LABEL_context|))*{l} - -- if (l' < |C.LABEL_context|) - -- (Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l]))*{l} - -- Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l']) + ;; 6-typing.watsup:922.1-924.22 + rule memory.grow {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) + -- if (x < |C.MEM_context|) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:610.1-613.31 - rule br_on_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) - -- if (l < |C.LABEL_context|) - -- if (C.LABEL_context[l] = t*{t}) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:918.1-920.22 + rule memory.size {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) + -- if (x < |C.MEM_context|) + -- if (C.MEM_context[x] = mt) - ;; 6-typing.watsup:615.1-618.31 - rule br_on_non_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: - `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) - -- if (l < |C.LABEL_context|) - -- if (C.LABEL_context[l] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:911.1-913.23 + rule elem.drop {C : context, rt : reftype, x : idx}: + `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) + -- if (x < |C.ELEM_context|) + -- if (C.ELEM_context[x] = rt) - ;; 6-typing.watsup:620.1-626.34 - rule br_on_cast {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: - `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype($diffrt(rt_1, rt_2))])) - -- if (l < |C.LABEL_context|) - -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) - -- Reftype_ok: `%|-%:OK`(C, rt_1) - -- Reftype_ok: `%|-%:OK`(C, rt_2) + ;; 6-typing.watsup:905.1-909.36 + rule table.init {C : context, lim : limits, rt_1 : reftype, rt_2 : reftype, x : idx, y : idx}: + `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (x < |C.TABLE_context|) + -- if (y < |C.ELEM_context|) + -- if (C.TABLE_context[x] = `%%`(lim, rt_1)) + -- if (C.ELEM_context[y] = rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) - ;; 6-typing.watsup:628.1-634.49 - rule br_on_cast_fail {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: - `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype(rt_2)])) - -- if (l < |C.LABEL_context|) - -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) - -- Reftype_ok: `%|-%:OK`(C, rt_1) - -- Reftype_ok: `%|-%:OK`(C, rt_2) + ;; 6-typing.watsup:899.1-903.36 + rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt_1 : reftype, rt_2 : reftype, x_1 : idx, x_2 : idx}: + `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) + -- if (x_1 < |C.TABLE_context|) + -- if (x_2 < |C.TABLE_context|) + -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt_1)) + -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt_2)) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) - -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) - - ;; 6-typing.watsup:639.1-641.24 - rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) - -- if (C.RETURN_context = ?(t*{t})) - ;; 6-typing.watsup:643.1-645.46 - rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: - `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) - -- if (x < |C.FUNC_context|) - -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - - ;; 6-typing.watsup:647.1-649.46 - rule call_ref {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: - `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_2*{t_2})) - -- if (x < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - - ;; 6-typing.watsup:651.1-655.46 - rule call_indirect {C : context, lim : limits, rt : reftype, t_1* : valtype*, t_2* : valtype*, x : idx, y : idx}: - `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + ;; 6-typing.watsup:895.1-897.28 + rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) -- if (x < |C.TABLE_context|) - -- if (y < |C.TYPE_context|) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - - ;; 6-typing.watsup:657.1-661.40 - rule return_call {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: - `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) - -- if (x < |C.FUNC_context|) - -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:663.1-667.40 - rule return_call_ref {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: - `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_4*{t_4})) - -- if (x < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - - ;; 6-typing.watsup:669.1-675.40 - rule return_call_indirect {C : context, lim : limits, rt : reftype, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx, y : idx}: - `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) + ;; 6-typing.watsup:891.1-893.28 + rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) -- if (x < |C.TABLE_context|) - -- if (y < |C.TYPE_context|) -- if (C.TABLE_context[x] = `%%`(lim, rt)) - -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) - -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - -- if (C.RETURN_context = ?(t'_2*{t'_2})) - -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - - ;; 6-typing.watsup:680.1-681.33 - rule const {C : context, c_nt : c, nt : numtype}: - `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) - - ;; 6-typing.watsup:683.1-684.31 - rule unop {C : context, nt : numtype, unop : unop_numtype}: - `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - - ;; 6-typing.watsup:686.1-687.36 - rule binop {C : context, binop : binop_numtype, nt : numtype}: - `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) - - ;; 6-typing.watsup:689.1-690.36 - rule testop {C : context, nt : numtype, testop : testop_numtype}: - `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) - - ;; 6-typing.watsup:692.1-693.37 - rule relop {C : context, nt : numtype, relop : relop_numtype}: - `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) - - ;; 6-typing.watsup:696.1-698.23 - rule extend {C : context, n : n, nt : numtype, o0 : nat}: - `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- if (n <= o0) - - ;; 6-typing.watsup:700.1-703.34 - rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype, o0 : nat, o1 : nat}: - `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) - -- if ($size($valtype_numtype(nt_1)) = ?(o0)) - -- if ($size($valtype_numtype(nt_2)) = ?(o1)) - -- if (nt_1 =/= nt_2) - -- if (o0 = o1) - - ;; 6-typing.watsup:705.1-708.50 - rule convert-i {C : context, inn_1 : inn, inn_2 : inn, sx? : sx?, o0 : nat, o1 : nat}: - `%|-%:%`(C, CVTOP_instr($numtype_inn(inn_1), CONVERT_cvtop, $numtype_inn(inn_2), sx?{sx}), `%->%`([$valtype_inn(inn_2)], [$valtype_inn(inn_1)])) - -- if ($size($valtype_inn(inn_1)) = ?(o0)) - -- if ($size($valtype_inn(inn_2)) = ?(o1)) - -- if (inn_1 =/= inn_2) - -- if ((sx?{sx} = ?()) <=> (o0 > o1)) - - ;; 6-typing.watsup:710.1-712.24 - rule convert-f {C : context, fnn_1 : fnn, fnn_2 : fnn}: - `%|-%:%`(C, CVTOP_instr($numtype_fnn(fnn_1), CONVERT_cvtop, $numtype_fnn(fnn_2), ?()), `%->%`([$valtype_fnn(fnn_2)], [$valtype_fnn(fnn_1)])) - -- if (fnn_1 =/= fnn_2) - - ;; 6-typing.watsup:717.1-719.31 - rule ref.null {C : context, ht : heaptype}: - `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) - -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:722.1-724.23 - rule ref.func {C : context, dt : deftype, epsilon : resulttype, x : idx}: - `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), $heaptype_deftype(dt))])) - -- if (x < |C.FUNC_context|) - -- if (C.FUNC_context[x] = dt) + ;; 6-typing.watsup:887.1-889.24 + rule table.size {C : context, tt : tabletype, x : idx}: + `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) + -- if (x < |C.TABLE_context|) + -- if (C.TABLE_context[x] = tt) - ;; 6-typing.watsup:726.1-727.34 - rule ref.i31 {C : context}: - `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) + ;; 6-typing.watsup:883.1-885.28 + rule table.set {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) + -- if (x < |C.TABLE_context|) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:729.1-730.31 - rule ref.is_null {C : context, rt : reftype}: - `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) + ;; 6-typing.watsup:879.1-881.28 + rule table.get {C : context, lim : limits, rt : reftype, x : idx}: + `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) + -- if (x < |C.TABLE_context|) + -- if (C.TABLE_context[x] = `%%`(lim, rt)) - ;; 6-typing.watsup:732.1-734.31 - rule ref.as_non_null {C : context, ht : heaptype}: - `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) - -- Heaptype_ok: `%|-%:OK`(C, ht) + ;; 6-typing.watsup:872.1-874.28 + rule global.set {C : context, t : valtype, x : idx}: + `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) + -- if (x < |C.GLOBAL_context|) + -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?(())), t)) - ;; 6-typing.watsup:736.1-737.51 - rule ref.eq {C : context}: - `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) + ;; 6-typing.watsup:868.1-870.28 + rule global.get {C : context, mut : mut, t : valtype, x : idx}: + `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) + -- if (x < |C.GLOBAL_context|) + -- if (C.GLOBAL_context[x] = `%%`(mut, t)) - ;; 6-typing.watsup:739.1-743.33 - rule ref.test {C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([$valtype_reftype(rt')], [I32_valtype])) - -- Reftype_ok: `%|-%:OK`(C, rt) - -- Reftype_ok: `%|-%:OK`(C, rt') - -- Reftype_sub: `%|-%<:%`(C, rt, rt') + ;; 6-typing.watsup:853.1-855.28 + rule local.get {C : context, init : init, t : valtype, x : idx}: + `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) + -- if (x < |C.LOCAL_context|) + -- if (C.LOCAL_context[x] = `%%`(init, t)) - ;; 6-typing.watsup:745.1-749.33 - rule ref.cast {C : context, rt : reftype, rt' : reftype}: - `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([$valtype_reftype(rt')], [$valtype_reftype(rt)])) - -- Reftype_ok: `%|-%:OK`(C, rt) - -- Reftype_ok: `%|-%:OK`(C, rt') - -- Reftype_sub: `%|-%<:%`(C, rt, rt') + ;; 6-typing.watsup:847.1-848.62 + rule any.convert_extern {C : context, nul : nul}: + `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) - ;; 6-typing.watsup:754.1-755.42 - rule i31.get {C : context, sx : sx}: - `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) + ;; 6-typing.watsup:844.1-845.62 + rule extern.convert_any {C : context, nul : nul}: + `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) - ;; 6-typing.watsup:760.1-762.43 - rule struct.new {C : context, mut* : mut*, x : idx, zt* : storagetype*}: - `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + ;; 6-typing.watsup:835.1-839.23 + rule array.init_data {C : context, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) -- if (x < |C.TYPE_context|) - -- if (|mut*{mut}| = |zt*{zt}|) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- if (y < |C.DATA_context|) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) + -- if (C.DATA_context[y] = OK) - ;; 6-typing.watsup:764.1-767.43 - rule struct.new_default {C : context, mut* : mut*, val* : val*, x : idx, zt* : storagetype*}: - `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + ;; 6-typing.watsup:830.1-833.43 + rule array.init_elem {C : context, x : idx, y : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) -- if (x < |C.TYPE_context|) - -- if (|mut*{mut}| = |zt*{zt}|) - -- if (|val*{val}| = |zt*{zt}|) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} + -- if (y < |C.ELEM_context|) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- Storagetype_sub: `%|-%<:%`(C, $storagetype_elemtype(C.ELEM_context[y]), zt) - ;; 6-typing.watsup:769.1-773.43 - rule struct.get {C : context, i : nat, mut : mut, sx? : sx?, x : idx, yt* : fieldtype*, zt : storagetype}: - `%|-%:%`(C, STRUCT.GET_instr(sx?{sx}, x, i), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], [$unpacktype(zt)])) + ;; 6-typing.watsup:824.1-828.40 + rule array.copy {C : context, mut : mut, x_1 : idx, x_2 : idx, zt_1 : storagetype, zt_2 : storagetype}: + `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_1))) I32_valtype REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_2))) I32_valtype I32_valtype], [])) + -- if (x_1 < |C.TYPE_context|) + -- if (x_2 < |C.TYPE_context|) + -- Expand: `%~~%`(C.TYPE_context[x_1], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) + -- Expand: `%~~%`(C.TYPE_context[x_2], ARRAY_comptype(`%%`(mut, zt_2))) + -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) + + ;; 6-typing.watsup:820.1-822.41 + rule array.fill {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt) I32_valtype], [])) -- if (x < |C.TYPE_context|) - -- if (i < |yt*{yt}|) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(mut, zt)) - -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:775.1-778.24 - rule struct.set {C : context, i : nat, x : idx, yt* : fieldtype*, zt : storagetype}: - `%|-%:%`(C, STRUCT.SET_instr(x, i), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) $unpacktype(zt)], [])) + ;; 6-typing.watsup:816.1-818.41 + rule array.len {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) -- if (x < |C.TYPE_context|) - -- if (i < |yt*{yt}|) - -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) - -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:783.1-785.41 - rule array.new {C : context, mut : mut, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpacktype(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + ;; 6-typing.watsup:812.1-814.41 + rule array.set {C : context, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt)], [])) -- if (x < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - ;; 6-typing.watsup:787.1-790.40 - rule array.new_default {C : context, mut : mut, val : val, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + ;; 6-typing.watsup:807.1-810.43 + rule array.get {C : context, mut : mut, sx? : sx?, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype], [$unpacktype(zt)])) -- if (x < |C.TYPE_context|) -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - -- if ($default($unpacktype(zt)) = ?(val)) + -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) - ;; 6-typing.watsup:792.1-794.41 - rule array.new_fixed {C : context, mut : mut, n : n, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpacktype(zt)], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + ;; 6-typing.watsup:801.1-805.23 + rule array.new_data {C : context, mut : mut, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx}: + `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) -- if (x < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) + -- if (y < |C.DATA_context|) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_valtype(t)))) + -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) + -- if (C.DATA_context[y] = OK) ;; 6-typing.watsup:796.1-799.39 rule array.new_elem {C : context, mut : mut, rt : reftype, x : idx, y : idx}: @@ -27680,217 +27735,306 @@ relation Instr_ok: `%|-%:%`(context, instr, functype) -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_reftype(rt)))) -- Reftype_sub: `%|-%<:%`(C, C.ELEM_context[y], rt) - ;; 6-typing.watsup:801.1-805.23 - rule array.new_data {C : context, mut : mut, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx}: - `%|-%:%`(C, ARRAY.NEW_DATA_instr(x, y), `%->%`([I32_valtype I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) + ;; 6-typing.watsup:792.1-794.41 + rule array.new_fixed {C : context, mut : mut, n : n, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_FIXED_instr(x, n), `%->%`([$unpacktype(zt)], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) -- if (x < |C.TYPE_context|) - -- if (y < |C.DATA_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, $storagetype_valtype(t)))) - -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) - -- if (C.DATA_context[y] = OK) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - ;; 6-typing.watsup:807.1-810.43 - rule array.get {C : context, mut : mut, sx? : sx?, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.GET_instr(sx?{sx}, x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype], [$unpacktype(zt)])) + ;; 6-typing.watsup:787.1-790.40 + rule array.new_default {C : context, mut : mut, val : val, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_DEFAULT_instr(x), `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) -- if (x < |C.TYPE_context|) -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) + -- if ($default($unpacktype(zt)) = ?(val)) - ;; 6-typing.watsup:812.1-814.41 - rule array.set {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.SET_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt)], [])) + ;; 6-typing.watsup:783.1-785.41 + rule array.new {C : context, mut : mut, x : idx, zt : storagetype}: + `%|-%:%`(C, ARRAY.NEW_instr(x), `%->%`([$unpacktype(zt) I32_valtype], [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) -- if (x < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(mut, zt))) - ;; 6-typing.watsup:816.1-818.41 - rule array.len {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.LEN_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ARRAY_heaptype)], [I32_valtype])) + ;; 6-typing.watsup:775.1-778.24 + rule struct.set {C : context, i : nat, x : idx, yt* : fieldtype*, zt : storagetype}: + `%|-%:%`(C, STRUCT.SET_instr(x, i), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) $unpacktype(zt)], [])) -- if (x < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) + -- if (i < |yt*{yt}|) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) + -- if (yt*{yt}[i] = `%%`(`MUT%?`(?(())), zt)) - ;; 6-typing.watsup:820.1-822.41 - rule array.fill {C : context, x : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.FILL_instr(x), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype $unpacktype(zt) I32_valtype], [])) + ;; 6-typing.watsup:769.1-773.43 + rule struct.get {C : context, i : nat, mut : mut, sx? : sx?, x : idx, yt* : fieldtype*, zt : storagetype}: + `%|-%:%`(C, STRUCT.GET_instr(sx?{sx}, x, i), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], [$unpacktype(zt)])) -- if (x < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - - ;; 6-typing.watsup:824.1-828.40 - rule array.copy {C : context, mut : mut, x_1 : idx, x_2 : idx, zt_1 : storagetype, zt_2 : storagetype}: - `%|-%:%`(C, ARRAY.COPY_instr(x_1, x_2), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_1))) I32_valtype REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x_2))) I32_valtype I32_valtype], [])) - -- if (x_1 < |C.TYPE_context|) - -- if (x_2 < |C.TYPE_context|) - -- Expand: `%~~%`(C.TYPE_context[x_1], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt_1))) - -- Expand: `%~~%`(C.TYPE_context[x_2], ARRAY_comptype(`%%`(mut, zt_2))) - -- Storagetype_sub: `%|-%<:%`(C, zt_2, zt_1) + -- if (i < |yt*{yt}|) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(yt*{yt})) + -- if (yt*{yt}[i] = `%%`(mut, zt)) + -- if ((sx?{sx} = ?()) <=> (zt = $storagetype_valtype($unpacktype(zt)))) - ;; 6-typing.watsup:830.1-833.43 - rule array.init_elem {C : context, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_ELEM_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) + ;; 6-typing.watsup:764.1-767.43 + rule struct.new_default {C : context, mut* : mut*, val* : val*, x : idx, zt* : storagetype*}: + `%|-%:%`(C, STRUCT.NEW_DEFAULT_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) -- if (x < |C.TYPE_context|) - -- if (y < |C.ELEM_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- Storagetype_sub: `%|-%<:%`(C, $storagetype_elemtype(C.ELEM_context[y]), zt) + -- if (|mut*{mut}| = |zt*{zt}|) + -- if (|val*{val}| = |zt*{zt}|) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} - ;; 6-typing.watsup:835.1-839.23 - rule array.init_data {C : context, numtype : numtype, t : valtype, vectype : vectype, x : idx, y : idx, zt : storagetype}: - `%|-%:%`(C, ARRAY.INIT_DATA_instr(x, y), `%->%`([REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x))) I32_valtype I32_valtype I32_valtype], [])) + ;; 6-typing.watsup:760.1-762.43 + rule struct.new {C : context, mut* : mut*, x : idx, zt* : storagetype*}: + `%|-%:%`(C, STRUCT.NEW_instr(x), `%->%`($unpacktype(zt)*{zt}, [REF_valtype(`NULL%?`(?()), $heaptype_typevar($idx(x)))])) -- if (x < |C.TYPE_context|) - -- if (y < |C.DATA_context|) - -- Expand: `%~~%`(C.TYPE_context[x], ARRAY_comptype(`%%`(`MUT%?`(?(())), zt))) - -- if ((t = $valtype_numtype(numtype)) \/ (t = $valtype_vectype(vectype))) - -- if (C.DATA_context[y] = OK) + -- if (|mut*{mut}| = |zt*{zt}|) + -- Expand: `%~~%`(C.TYPE_context[x], STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - ;; 6-typing.watsup:844.1-845.62 - rule extern.convert_any {C : context, nul : nul}: - `%|-%:%`(C, EXTERN.CONVERT_ANY_instr, `%->%`([REF_valtype(nul, ANY_heaptype)], [REF_valtype(nul, EXTERN_heaptype)])) + ;; 6-typing.watsup:754.1-755.42 + rule i31.get {C : context, sx : sx}: + `%|-%:%`(C, I31.GET_instr(sx), `%->%`([REF_valtype(`NULL%?`(?(())), I31_heaptype)], [I32_valtype])) - ;; 6-typing.watsup:847.1-848.62 - rule any.convert_extern {C : context, nul : nul}: - `%|-%:%`(C, ANY.CONVERT_EXTERN_instr, `%->%`([REF_valtype(nul, EXTERN_heaptype)], [REF_valtype(nul, ANY_heaptype)])) + ;; 6-typing.watsup:745.1-749.33 + rule ref.cast {C : context, rt : reftype, rt' : reftype}: + `%|-%:%`(C, REF.CAST_instr(rt), `%->%`([$valtype_reftype(rt')], [$valtype_reftype(rt)])) + -- Reftype_ok: `%|-%:OK`(C, rt) + -- Reftype_ok: `%|-%:OK`(C, rt') + -- Reftype_sub: `%|-%<:%`(C, rt, rt') + + ;; 6-typing.watsup:739.1-743.33 + rule ref.test {C : context, rt : reftype, rt' : reftype}: + `%|-%:%`(C, REF.TEST_instr(rt), `%->%`([$valtype_reftype(rt')], [I32_valtype])) + -- Reftype_ok: `%|-%:OK`(C, rt) + -- Reftype_ok: `%|-%:OK`(C, rt') + -- Reftype_sub: `%|-%<:%`(C, rt, rt') + + ;; 6-typing.watsup:736.1-737.51 + rule ref.eq {C : context}: + `%|-%:%`(C, REF.EQ_instr, `%->%`([REF_valtype(`NULL%?`(?(())), EQ_heaptype) REF_valtype(`NULL%?`(?(())), EQ_heaptype)], [I32_valtype])) + + ;; 6-typing.watsup:732.1-734.31 + rule ref.as_non_null {C : context, ht : heaptype}: + `%|-%:%`(C, REF.AS_NON_NULL_instr, `%->%`([REF_valtype(`NULL%?`(?(())), ht)], [REF_valtype(`NULL%?`(?()), ht)])) + -- Heaptype_ok: `%|-%:OK`(C, ht) + + ;; 6-typing.watsup:729.1-730.31 + rule ref.is_null {C : context, rt : reftype}: + `%|-%:%`(C, REF.IS_NULL_instr, `%->%`([$valtype_reftype(rt)], [I32_valtype])) + + ;; 6-typing.watsup:726.1-727.34 + rule ref.i31 {C : context}: + `%|-%:%`(C, REF.I31_instr, `%->%`([I32_valtype], [REF_valtype(`NULL%?`(?()), I31_heaptype)])) + + ;; 6-typing.watsup:722.1-724.23 + rule ref.func {C : context, dt : deftype, epsilon : resulttype, x : idx}: + `%|-%:%`(C, REF.FUNC_instr(x), `%->%`(epsilon, [REF_valtype(`NULL%?`(?()), $heaptype_deftype(dt))])) + -- if (x < |C.FUNC_context|) + -- if (C.FUNC_context[x] = dt) + + ;; 6-typing.watsup:717.1-719.31 + rule ref.null {C : context, ht : heaptype}: + `%|-%:%`(C, REF.NULL_instr(ht), `%->%`([], [REF_valtype(`NULL%?`(?(())), ht)])) + -- Heaptype_ok: `%|-%:OK`(C, ht) + + ;; 6-typing.watsup:710.1-712.24 + rule convert-f {C : context, fnn_1 : fnn, fnn_2 : fnn}: + `%|-%:%`(C, CVTOP_instr($numtype_fnn(fnn_1), CONVERT_cvtop, $numtype_fnn(fnn_2), ?()), `%->%`([$valtype_fnn(fnn_2)], [$valtype_fnn(fnn_1)])) + -- if (fnn_1 =/= fnn_2) + + ;; 6-typing.watsup:705.1-708.50 + rule convert-i {C : context, inn_1 : inn, inn_2 : inn, sx? : sx?, o0 : nat, o1 : nat}: + `%|-%:%`(C, CVTOP_instr($numtype_inn(inn_1), CONVERT_cvtop, $numtype_inn(inn_2), sx?{sx}), `%->%`([$valtype_inn(inn_2)], [$valtype_inn(inn_1)])) + -- if ($size($valtype_inn(inn_1)) = ?(o0)) + -- if ($size($valtype_inn(inn_2)) = ?(o1)) + -- if (inn_1 =/= inn_2) + -- if ((sx?{sx} = ?()) <=> (o0 > o1)) + + ;; 6-typing.watsup:700.1-703.34 + rule reinterpret {C : context, nt_1 : numtype, nt_2 : numtype, o0 : nat, o1 : nat}: + `%|-%:%`(C, CVTOP_instr(nt_1, REINTERPRET_cvtop, nt_2, ?()), `%->%`([$valtype_numtype(nt_2)], [$valtype_numtype(nt_1)])) + -- if ($size($valtype_numtype(nt_1)) = ?(o0)) + -- if ($size($valtype_numtype(nt_2)) = ?(o1)) + -- if (nt_1 =/= nt_2) + -- if (o0 = o1) + + ;; 6-typing.watsup:696.1-698.23 + rule extend {C : context, n : n, nt : numtype, o0 : nat}: + `%|-%:%`(C, EXTEND_instr(nt, n), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) + -- if ($size($valtype_numtype(nt)) = ?(o0)) + -- if (n <= o0) + + ;; 6-typing.watsup:692.1-693.37 + rule relop {C : context, nt : numtype, relop : relop_numtype}: + `%|-%:%`(C, RELOP_instr(nt, relop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [I32_valtype])) + + ;; 6-typing.watsup:689.1-690.36 + rule testop {C : context, nt : numtype, testop : testop_numtype}: + `%|-%:%`(C, TESTOP_instr(nt, testop), `%->%`([$valtype_numtype(nt)], [I32_valtype])) - ;; 6-typing.watsup:853.1-855.28 - rule local.get {C : context, init : init, t : valtype, x : idx}: - `%|-%:%`(C, LOCAL.GET_instr(x), `%->%`([], [t])) - -- if (x < |C.LOCAL_context|) - -- if (C.LOCAL_context[x] = `%%`(init, t)) + ;; 6-typing.watsup:686.1-687.36 + rule binop {C : context, binop : binop_numtype, nt : numtype}: + `%|-%:%`(C, BINOP_instr(nt, binop), `%->%`([$valtype_numtype(nt) $valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:868.1-870.28 - rule global.get {C : context, mut : mut, t : valtype, x : idx}: - `%|-%:%`(C, GLOBAL.GET_instr(x), `%->%`([], [t])) - -- if (x < |C.GLOBAL_context|) - -- if (C.GLOBAL_context[x] = `%%`(mut, t)) + ;; 6-typing.watsup:683.1-684.31 + rule unop {C : context, nt : numtype, unop : unop_numtype}: + `%|-%:%`(C, UNOP_instr(nt, unop), `%->%`([$valtype_numtype(nt)], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:872.1-874.28 - rule global.set {C : context, t : valtype, x : idx}: - `%|-%:%`(C, GLOBAL.SET_instr(x), `%->%`([t], [])) - -- if (x < |C.GLOBAL_context|) - -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?(())), t)) + ;; 6-typing.watsup:680.1-681.33 + rule const {C : context, c_nt : c, nt : numtype}: + `%|-%:%`(C, CONST_instr(nt, c_nt), `%->%`([], [$valtype_numtype(nt)])) - ;; 6-typing.watsup:879.1-881.28 - rule table.get {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.GET_instr(x), `%->%`([I32_valtype], [$valtype_reftype(rt)])) + ;; 6-typing.watsup:669.1-675.40 + rule return_call_indirect {C : context, lim : limits, rt : reftype, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx, y : idx}: + `%|-%:%`(C, RETURN_CALL_INDIRECT_instr(x, y), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [I32_valtype], t_4*{t_4})) -- if (x < |C.TABLE_context|) + -- if (y < |C.TYPE_context|) -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) + -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:883.1-885.28 - rule table.set {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.SET_instr(x), `%->%`([I32_valtype $valtype_reftype(rt)], [])) - -- if (x < |C.TABLE_context|) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:663.1-667.40 + rule return_call_ref {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: + `%|-%:%`(C, RETURN_CALL_REF_instr(?(x)), `%->%`(t_3*{t_3} :: t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_4*{t_4})) + -- if (x < |C.TYPE_context|) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:887.1-889.24 - rule table.size {C : context, tt : tabletype, x : idx}: - `%|-%:%`(C, TABLE.SIZE_instr(x), `%->%`([], [I32_valtype])) - -- if (x < |C.TABLE_context|) - -- if (C.TABLE_context[x] = tt) + ;; 6-typing.watsup:657.1-661.40 + rule return_call {C : context, t'_2* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, t_4* : valtype*, x : idx}: + `%|-%:%`(C, RETURN_CALL_instr(x), `%->%`(t_3*{t_3} :: t_1*{t_1}, t_4*{t_4})) + -- if (x < |C.FUNC_context|) + -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + -- if (C.RETURN_context = ?(t'_2*{t'_2})) + -- Resulttype_sub: `%|-%*<:%*`(C, t_2*{t_2}, t'_2*{t'_2}) - ;; 6-typing.watsup:891.1-893.28 - rule table.grow {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.GROW_instr(x), `%->%`([$valtype_reftype(rt) I32_valtype], [I32_valtype])) + ;; 6-typing.watsup:651.1-655.46 + rule call_indirect {C : context, lim : limits, rt : reftype, t_1* : valtype*, t_2* : valtype*, x : idx, y : idx}: + `%|-%:%`(C, CALL_INDIRECT_instr(x, y), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) -- if (x < |C.TABLE_context|) + -- if (y < |C.TYPE_context|) -- if (C.TABLE_context[x] = `%%`(lim, rt)) + -- Reftype_sub: `%|-%<:%`(C, rt, REF_reftype(`NULL%?`(?(())), FUNC_heaptype)) + -- Expand: `%~~%`(C.TYPE_context[y], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:895.1-897.28 - rule table.fill {C : context, lim : limits, rt : reftype, x : idx}: - `%|-%:%`(C, TABLE.FILL_instr(x), `%->%`([I32_valtype $valtype_reftype(rt) I32_valtype], [])) - -- if (x < |C.TABLE_context|) - -- if (C.TABLE_context[x] = `%%`(lim, rt)) + ;; 6-typing.watsup:647.1-649.46 + rule call_ref {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: + `%|-%:%`(C, CALL_REF_instr(?(x)), `%->%`(t_1*{t_1} :: [REF_valtype(`NULL%?`(?(())), $heaptype_typevar($idx(x)))], t_2*{t_2})) + -- if (x < |C.TYPE_context|) + -- Expand: `%~~%`(C.TYPE_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) - ;; 6-typing.watsup:899.1-903.36 - rule table.copy {C : context, lim_1 : limits, lim_2 : limits, rt_1 : reftype, rt_2 : reftype, x_1 : idx, x_2 : idx}: - `%|-%:%`(C, TABLE.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (x_1 < |C.TABLE_context|) - -- if (x_2 < |C.TABLE_context|) - -- if (C.TABLE_context[x_1] = `%%`(lim_1, rt_1)) - -- if (C.TABLE_context[x_2] = `%%`(lim_2, rt_2)) + ;; 6-typing.watsup:643.1-645.46 + rule call {C : context, t_1* : valtype*, t_2* : valtype*, x : idx}: + `%|-%:%`(C, CALL_instr(x), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- if (x < |C.FUNC_context|) + -- Expand: `%~~%`(C.FUNC_context[x], FUNC_comptype(`%->%`(t_1*{t_1}, t_2*{t_2}))) + + ;; 6-typing.watsup:639.1-641.24 + rule return {C : context, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, RETURN_instr, `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- if (C.RETURN_context = ?(t*{t})) + + ;; 6-typing.watsup:628.1-634.49 + rule br_on_cast_fail {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: + `%|-%:%`(C, BR_ON_CAST_FAIL_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype(rt_2)])) + -- if (l < |C.LABEL_context|) + -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) + -- Reftype_ok: `%|-%:OK`(C, rt_1) + -- Reftype_ok: `%|-%:OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + -- Reftype_sub: `%|-%<:%`(C, $diffrt(rt_1, rt_2), rt) - ;; 6-typing.watsup:905.1-909.36 - rule table.init {C : context, lim : limits, rt_1 : reftype, rt_2 : reftype, x : idx, y : idx}: - `%|-%:%`(C, TABLE.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (x < |C.TABLE_context|) - -- if (y < |C.ELEM_context|) - -- if (C.TABLE_context[x] = `%%`(lim, rt_1)) - -- if (C.ELEM_context[y] = rt_2) + ;; 6-typing.watsup:620.1-626.34 + rule br_on_cast {C : context, l : labelidx, rt : reftype, rt_1 : reftype, rt_2 : reftype, t* : valtype*}: + `%|-%:%`(C, BR_ON_CAST_instr(l, rt_1, rt_2), `%->%`(t*{t} :: [$valtype_reftype(rt_1)], t*{t} :: [$valtype_reftype($diffrt(rt_1, rt_2))])) + -- if (l < |C.LABEL_context|) + -- if (C.LABEL_context[l] = t*{t} :: [$valtype_reftype(rt)]) + -- Reftype_ok: `%|-%:OK`(C, rt_1) + -- Reftype_ok: `%|-%:OK`(C, rt_2) -- Reftype_sub: `%|-%<:%`(C, rt_2, rt_1) + -- Reftype_sub: `%|-%<:%`(C, rt_2, rt) - ;; 6-typing.watsup:911.1-913.23 - rule elem.drop {C : context, rt : reftype, x : idx}: - `%|-%:%`(C, ELEM.DROP_instr(x), `%->%`([], [])) - -- if (x < |C.ELEM_context|) - -- if (C.ELEM_context[x] = rt) + ;; 6-typing.watsup:615.1-618.31 + rule br_on_non_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_ON_NON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t})) + -- if (l < |C.LABEL_context|) + -- if (C.LABEL_context[l] = t*{t} :: [REF_valtype(`NULL%?`(?()), ht)]) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:918.1-920.22 - rule memory.size {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.SIZE_instr(x), `%->%`([], [I32_valtype])) - -- if (x < |C.MEM_context|) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:610.1-613.31 + rule br_on_null {C : context, ht : heaptype, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_ON_NULL_instr(l), `%->%`(t*{t} :: [REF_valtype(`NULL%?`(?(())), ht)], t*{t} :: [REF_valtype(`NULL%?`(?()), ht)])) + -- if (l < |C.LABEL_context|) + -- if (C.LABEL_context[l] = t*{t}) + -- Heaptype_ok: `%|-%:OK`(C, ht) - ;; 6-typing.watsup:922.1-924.22 - rule memory.grow {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.GROW_instr(x), `%->%`([I32_valtype], [I32_valtype])) - -- if (x < |C.MEM_context|) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:605.1-608.44 + rule br_table {C : context, l* : labelidx*, l' : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, BR_TABLE_instr(l*{l}, l'), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- (if (l < |C.LABEL_context|))*{l} + -- if (l' < |C.LABEL_context|) + -- (Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l]))*{l} + -- Resulttype_sub: `%|-%*<:%*`(C, t*{t}, C.LABEL_context[l']) - ;; 6-typing.watsup:926.1-928.22 - rule memory.fill {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEMORY.FILL_instr(x), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (x < |C.MEM_context|) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:601.1-603.24 + rule br_if {C : context, l : labelidx, t* : valtype*}: + `%|-%:%`(C, BR_IF_instr(l), `%->%`(t*{t} :: [I32_valtype], t*{t})) + -- if (l < |C.LABEL_context|) + -- if (C.LABEL_context[l] = t*{t}) - ;; 6-typing.watsup:930.1-933.26 - rule memory.copy {C : context, mt_1 : memtype, mt_2 : memtype, x_1 : idx, x_2 : idx}: - `%|-%:%`(C, MEMORY.COPY_instr(x_1, x_2), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (x_1 < |C.MEM_context|) - -- if (x_2 < |C.MEM_context|) - -- if (C.MEM_context[x_1] = mt_1) - -- if (C.MEM_context[x_2] = mt_2) + ;; 6-typing.watsup:597.1-599.24 + rule br {C : context, l : labelidx, t* : valtype*, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, BR_instr(l), `%->%`(t_1*{t_1} :: t*{t}, t_2*{t_2})) + -- if (l < |C.LABEL_context|) + -- if (C.LABEL_context[l] = t*{t}) - ;; 6-typing.watsup:935.1-938.23 - rule memory.init {C : context, mt : memtype, x : idx, y : idx}: - `%|-%:%`(C, MEMORY.INIT_instr(x, y), `%->%`([I32_valtype I32_valtype I32_valtype], [])) - -- if (x < |C.MEM_context|) - -- if (y < |C.DATA_context|) - -- if (C.MEM_context[x] = mt) - -- if (C.DATA_context[y] = OK) + ;; 6-typing.watsup:588.1-592.65 + rule if {C : context, bt : blocktype, instr_1* : instr*, instr_2* : instr*, t_1* : valtype*, t_2* : valtype*, x_1* : idx*, x_2* : idx*}: + `%|-%:%`(C, IF_instr(bt, instr_1*{instr_1}, instr_2*{instr_2}), `%->%`(t_1*{t_1} :: [I32_valtype], t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_1*{instr_1}, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr_2*{instr_2}, `%->%*%`(t_1*{t_1}, x_2*{x_2}, t_2*{t_2})) - ;; 6-typing.watsup:940.1-942.23 - rule data.drop {C : context, x : idx}: - `%|-%:%`(C, DATA.DROP_instr(x), `%->%`([], [])) - -- if (x < |C.DATA_context|) - -- if (C.DATA_context[x] = OK) + ;; 6-typing.watsup:583.1-586.61 + rule loop {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%:%`(C, LOOP_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_1*{t_1}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - ;; 6-typing.watsup:944.1-949.29 - rule load {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, sx? : sx?, x : idx, o0 : nat, o1? : nat?}: - `%|-%:%`(C, LOAD_instr(nt, (n, sx)?{n sx}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype], [$valtype_numtype(nt)])) - -- if (x < |C.MEM_context|) - -- if ((n?{n} = ?()) <=> (o1?{o1} = ?())) - -- if ((n?{n} = ?()) <=> (sx?{sx} = ?())) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- (if ($size($valtype_numtype(nt)) = ?(o1)))?{o1} - -- if (C.MEM_context[x] = mt) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} - -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) + ;; 6-typing.watsup:578.1-581.61 + rule block {C : context, bt : blocktype, instr* : instr*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%:%`(C, BLOCK_instr(bt, instr*{instr}), `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Blocktype_ok: `%|-%:%`(C, bt, `%->%`(t_1*{t_1}, t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C ++ {TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [t_2*{t_2}], RETURN ?()}, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) - ;; 6-typing.watsup:951.1-956.29 - rule store {C : context, inn : inn, mt : memtype, n? : n?, n_A : n, n_O : n, nt : numtype, x : idx, o0 : nat, o1? : nat?}: - `%|-%:%`(C, STORE_instr(nt, n?{n}, x, {ALIGN n_A, OFFSET n_O}), `%->%`([I32_valtype $valtype_numtype(nt)], [])) - -- if (x < |C.MEM_context|) - -- if ((n?{n} = ?()) <=> (o1?{o1} = ?())) - -- if ($size($valtype_numtype(nt)) = ?(o0)) - -- (if ($size($valtype_numtype(nt)) = ?(o1)))?{o1} - -- if (C.MEM_context[x] = mt) - -- if ((2 ^ n_A) <= (o0 / 8)) - -- (if (((2 ^ n_A) <= (n / 8)) /\ ((n / 8) < (o1 / 8))))?{n o1} - -- if ((n?{n} = ?()) \/ (nt = $numtype_inn(inn))) + ;; 6-typing.watsup:557.1-560.37 + rule select-impl {C : context, numtype : numtype, t : valtype, t' : valtype, vectype : vectype}: + `%|-%:%`(C, SELECT_instr(?()), `%->%`([t t I32_valtype], [t])) + -- Valtype_sub: `%|-%<:%`(C, t, t') + -- if ((t' = $valtype_numtype(numtype)) \/ (t' = $valtype_vectype(vectype))) + + ;; 6-typing.watsup:554.1-555.31 + rule select-expl {C : context, t : valtype}: + `%|-%:%`(C, SELECT_instr(?([t])), `%->%`([t t I32_valtype], [t])) + + ;; 6-typing.watsup:550.1-551.23 + rule drop {C : context, t : valtype}: + `%|-%:%`(C, DROP_instr, `%->%`([t], [])) + + ;; 6-typing.watsup:547.1-548.24 + rule nop {C : context}: + `%|-%:%`(C, NOP_instr, `%->%`([], [])) + + ;; 6-typing.watsup:544.1-545.34 + rule unreachable {C : context, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, UNREACHABLE_instr, `%->%`(t_1*{t_1}, t_2*{t_2})) ;; 6-typing.watsup:504.1-504.67 relation Instrf_ok: `%|-%:%`(context, instr, instrtype) - ;; 6-typing.watsup:518.1-520.41 - rule instr {C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: - `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) - -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) + ;; 6-typing.watsup:861.1-863.28 + rule local.tee {C : context, init : init, t : valtype, x : idx}: + `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) + -- if (x < |C.LOCAL_context|) + -- if (C.LOCAL_context[x] = `%%`(init, t)) ;; 6-typing.watsup:857.1-859.28 rule local.set {C : context, init : init, t : valtype, x : idx}: @@ -27898,17 +28042,23 @@ relation Instrf_ok: `%|-%:%`(context, instr, instrtype) -- if (x < |C.LOCAL_context|) -- if (C.LOCAL_context[x] = `%%`(init, t)) - ;; 6-typing.watsup:861.1-863.28 - rule local.tee {C : context, init : init, t : valtype, x : idx}: - `%|-%:%`(C, LOCAL.TEE_instr(x), `%->%*%`([t], [x], [t])) - -- if (x < |C.LOCAL_context|) - -- if (C.LOCAL_context[x] = `%%`(init, t)) + ;; 6-typing.watsup:518.1-520.41 + rule instr {C : context, instr : instr, t_1* : valtype*, t_2* : valtype*}: + `%|-%:%`(C, instr, `%->%*%`(t_1*{t_1}, [], t_2*{t_2})) + -- Instr_ok: `%|-%:%`(C, instr, `%->%`(t_1*{t_1}, t_2*{t_2})) ;; 6-typing.watsup:505.1-505.74 relation Instrs_ok: `%|-%*:%`(context, instr*, instrtype) - ;; 6-typing.watsup:522.1-523.29 - rule empty {C : context}: - `%|-%*:%`(C, [], `%->%*%`([], [], [])) + ;; 6-typing.watsup:537.1-539.47 + rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: + `%|-%*:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) + -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + + ;; 6-typing.watsup:532.1-535.35 + rule sub {C : context, instr* : instr*, it : instrtype, it' : instrtype}: + `%|-%*:%`(C, instr*{instr}, it') + -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, it) + -- Instrtype_sub: `%|-%<:%`(C, it, it') ;; 6-typing.watsup:525.1-530.52 rule seq {C : context, C' : context, init* : init*, instr_1 : instr, instr_2* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, t_3* : valtype*, x_1* : idx*, x_2* : idx*}: @@ -27921,16 +28071,9 @@ relation Instrs_ok: `%|-%*:%`(context, instr*, instrtype) -- Instrf_ok: `%|-%:%`(C, instr_1, `%->%*%`(t_1*{t_1}, x_1*{x_1}, t_2*{t_2})) -- Instrs_ok: `%|-%*:%`(C', instr_2*{instr_2}, `%->%*%`(t_2*{t_2}, x_2*{x_2}, t_3*{t_3})) - ;; 6-typing.watsup:532.1-535.35 - rule sub {C : context, instr* : instr*, it : instrtype, it' : instrtype}: - `%|-%*:%`(C, instr*{instr}, it') - -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, it) - -- Instrtype_sub: `%|-%<:%`(C, it, it') - - ;; 6-typing.watsup:537.1-539.47 - rule frame {C : context, instr* : instr*, t* : valtype*, t_1* : valtype*, t_2* : valtype*, x* : idx*}: - `%|-%*:%`(C, instr*{instr}, `%->%*%`(t*{t} :: t_1*{t_1}, x*{x}, t*{t} :: t_2*{t_2})) - -- Instrs_ok: `%|-%*:%`(C, instr*{instr}, `%->%*%`(t_1*{t_1}, x*{x}, t_2*{t_2})) + ;; 6-typing.watsup:522.1-523.29 + rule empty {C : context}: + `%|-%*:%`(C, [], `%->%*%`([], [], [])) } ;; 6-typing.watsup:506.1-506.72 @@ -27945,10 +28088,10 @@ rec { ;; 6-typing.watsup:985.1-985.64 def in_binop : (binop_numtype, ibinop*) -> bool - ;; 6-typing.watsup:986.1-986.38 - def {binop : binop_numtype, epsilon : ibinop*} in_binop(binop, epsilon) = false ;; 6-typing.watsup:987.1-987.92 def {binop : binop_numtype, ibinop'* : ibinop*, ibinop_1 : ibinop} in_binop(binop, [ibinop_1] :: ibinop'*{ibinop'}) = ((binop = _I_binop_numtype(ibinop_1)) \/ $in_binop(binop, ibinop'*{ibinop'})) + ;; 6-typing.watsup:986.1-986.38 + def {binop : binop_numtype, epsilon : ibinop*} in_binop(binop, epsilon) = false } ;; 6-typing.watsup:981.1-981.63 @@ -27956,25 +28099,19 @@ rec { ;; 6-typing.watsup:981.1-981.63 def in_numtype : (numtype, numtype*) -> bool - ;; 6-typing.watsup:982.1-982.37 - def {epsilon : numtype*, nt : numtype} in_numtype(nt, epsilon) = false ;; 6-typing.watsup:983.1-983.68 def {nt : numtype, nt'* : numtype*, nt_1 : numtype} in_numtype(nt, [nt_1] :: nt'*{nt'}) = ((nt = nt_1) \/ $in_numtype(nt, nt'*{nt'})) + ;; 6-typing.watsup:982.1-982.37 + def {epsilon : numtype*, nt : numtype} in_numtype(nt, epsilon) = false } ;; 6-typing.watsup:963.1-963.78 relation Instr_const: `%|-%CONST`(context, instr) - ;; 6-typing.watsup:967.1-968.26 - rule const {C : context, c : c, nt : numtype}: - `%|-%CONST`(C, CONST_instr(nt, c)) - - ;; 6-typing.watsup:970.1-971.27 - rule ref.null {C : context, ht : heaptype}: - `%|-%CONST`(C, REF.NULL_instr(ht)) - - ;; 6-typing.watsup:973.1-974.26 - rule ref.func {C : context, x : idx}: - `%|-%CONST`(C, REF.FUNC_instr(x)) + ;; 6-typing.watsup:989.1-992.38 + rule binop {C : context, binop : binop_numtype, nt : numtype}: + `%|-%CONST`(C, BINOP_instr(nt, binop)) + -- if $in_numtype(nt, [I32_numtype I64_numtype]) + -- if $in_binop(binop, [ADD_ibinop SUB_ibinop MUL_ibinop]) ;; 6-typing.watsup:976.1-978.24 rule global.get {C : context, t : valtype, x : idx}: @@ -27982,11 +28119,17 @@ relation Instr_const: `%|-%CONST`(context, instr) -- if (x < |C.GLOBAL_context|) -- if (C.GLOBAL_context[x] = `%%`(`MUT%?`(?()), t)) - ;; 6-typing.watsup:989.1-992.38 - rule binop {C : context, binop : binop_numtype, nt : numtype}: - `%|-%CONST`(C, BINOP_instr(nt, binop)) - -- if $in_numtype(nt, [I32_numtype I64_numtype]) - -- if $in_binop(binop, [ADD_ibinop SUB_ibinop MUL_ibinop]) + ;; 6-typing.watsup:973.1-974.26 + rule ref.func {C : context, x : idx}: + `%|-%CONST`(C, REF.FUNC_instr(x)) + + ;; 6-typing.watsup:970.1-971.27 + rule ref.null {C : context, ht : heaptype}: + `%|-%CONST`(C, REF.NULL_instr(ht)) + + ;; 6-typing.watsup:967.1-968.26 + rule const {C : context, c : c, nt : numtype}: + `%|-%CONST`(C, CONST_instr(nt, c)) ;; 6-typing.watsup:964.1-964.77 relation Expr_const: `%|-%CONST`(context, expr) @@ -28014,16 +28157,16 @@ relation Type_ok: `%|-%:%*`(context, type, deftype*) ;; 6-typing.watsup:1013.1-1013.74 relation Local_ok: `%|-%:%`(context, local, localtype) - ;; 6-typing.watsup:1029.1-1031.28 - rule set {C : context, t : valtype}: - `%|-%:%`(C, LOCAL(t), `%%`(SET_init, t)) - -- if ($default(t) =/= ?()) - ;; 6-typing.watsup:1033.1-1035.26 rule unset {C : context, t : valtype}: `%|-%:%`(C, LOCAL(t), `%%`(UNSET_init, t)) -- if ($default(t) = ?()) + ;; 6-typing.watsup:1029.1-1031.28 + rule set {C : context, t : valtype}: + `%|-%:%`(C, LOCAL(t), `%%`(SET_init, t)) + -- if ($default(t) =/= ?()) + ;; 6-typing.watsup:1012.1-1012.73 relation Func_ok: `%|-%:%`(context, func, deftype) ;; 6-typing.watsup:1037.1-1041.82 @@ -28062,6 +28205,14 @@ relation Mem_ok: `%|-%:%`(context, mem, memtype) ;; 6-typing.watsup:1019.1-1019.77 relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) + ;; 6-typing.watsup:1076.1-1077.20 + rule declare {C : context, rt : reftype}: + `%|-%:%`(C, DECLARE_elemmode, rt) + + ;; 6-typing.watsup:1073.1-1074.20 + rule passive {C : context, rt : reftype}: + `%|-%:%`(C, PASSIVE_elemmode, rt) + ;; 6-typing.watsup:1068.1-1071.45 rule active {C : context, expr : expr, lim : limits, rt : reftype, x : idx}: `%|-%:%`(C, ACTIVE_elemmode(x, expr), rt) @@ -28069,14 +28220,6 @@ relation Elemmode_ok: `%|-%:%`(context, elemmode, reftype) -- if (C.TABLE_context[x] = `%%`(lim, rt)) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 6-typing.watsup:1073.1-1074.20 - rule passive {C : context, rt : reftype}: - `%|-%:%`(C, PASSIVE_elemmode, rt) - - ;; 6-typing.watsup:1076.1-1077.20 - rule declare {C : context, rt : reftype}: - `%|-%:%`(C, DECLARE_elemmode, rt) - ;; 6-typing.watsup:1017.1-1017.73 relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup:1059.1-1062.37 @@ -28087,6 +28230,10 @@ relation Elem_ok: `%|-%:%`(context, elem, reftype) ;; 6-typing.watsup:1020.1-1020.77 relation Datamode_ok: `%|-%:OK`(context, datamode) + ;; 6-typing.watsup:1084.1-1085.20 + rule passive {C : context}: + `%|-%:OK`(C, PASSIVE_datamode) + ;; 6-typing.watsup:1079.1-1082.45 rule active {C : context, expr : expr, mt : memtype, x : idx}: `%|-%:OK`(C, ACTIVE_datamode(x, expr)) @@ -28094,10 +28241,6 @@ relation Datamode_ok: `%|-%:OK`(context, datamode) -- if (C.MEM_context[x] = mt) -- (Expr_ok_const: `%|-%:%CONST`(C, expr, I32_valtype))*{} - ;; 6-typing.watsup:1084.1-1085.20 - rule passive {C : context}: - `%|-%:OK`(C, PASSIVE_datamode) - ;; 6-typing.watsup:1018.1-1018.73 relation Data_ok: `%|-%:OK`(context, data) ;; 6-typing.watsup:1064.1-1066.37 @@ -28122,17 +28265,11 @@ relation Import_ok: `%|-%:%`(context, import, externtype) ;; 6-typing.watsup:1096.1-1096.83 relation Externidx_ok: `%|-%:%`(context, externidx, externtype) - ;; 6-typing.watsup:1107.1-1109.23 - rule func {C : context, dt : deftype, x : idx}: - `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) - -- if (x < |C.FUNC_context|) - -- if (C.FUNC_context[x] = dt) - - ;; 6-typing.watsup:1111.1-1113.25 - rule global {C : context, gt : globaltype, x : idx}: - `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) - -- if (x < |C.GLOBAL_context|) - -- if (C.GLOBAL_context[x] = gt) + ;; 6-typing.watsup:1119.1-1121.22 + rule mem {C : context, mt : memtype, x : idx}: + `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) + -- if (x < |C.MEM_context|) + -- if (C.MEM_context[x] = mt) ;; 6-typing.watsup:1115.1-1117.24 rule table {C : context, tt : tabletype, x : idx}: @@ -28140,11 +28277,17 @@ relation Externidx_ok: `%|-%:%`(context, externidx, externtype) -- if (x < |C.TABLE_context|) -- if (C.TABLE_context[x] = tt) - ;; 6-typing.watsup:1119.1-1121.22 - rule mem {C : context, mt : memtype, x : idx}: - `%|-%:%`(C, MEM_externidx(x), MEM_externtype(mt)) - -- if (x < |C.MEM_context|) - -- if (C.MEM_context[x] = mt) + ;; 6-typing.watsup:1111.1-1113.25 + rule global {C : context, gt : globaltype, x : idx}: + `%|-%:%`(C, GLOBAL_externidx(x), GLOBAL_externtype(gt)) + -- if (x < |C.GLOBAL_context|) + -- if (C.GLOBAL_context[x] = gt) + + ;; 6-typing.watsup:1107.1-1109.23 + rule func {C : context, dt : deftype, x : idx}: + `%|-%:%`(C, FUNC_externidx(x), FUNC_externtype(dt)) + -- if (x < |C.FUNC_context|) + -- if (C.FUNC_context[x] = dt) ;; 6-typing.watsup:1095.1-1095.80 relation Export_ok: `%|-%:%`(context, export, externtype) @@ -28158,15 +28301,15 @@ rec { ;; 6-typing.watsup:1128.1-1128.77 relation Globals_ok: `%|-%*:%*`(context, global*, globaltype*) - ;; 6-typing.watsup:1171.1-1172.17 - rule empty {C : context}: - `%|-%*:%*`(C, [], []) - ;; 6-typing.watsup:1174.1-1177.54 rule cons {C : context, global : global, global_1 : global, gt* : globaltype*, gt_1 : globaltype}: `%|-%*:%*`(C, [global_1] :: global*{}, [gt_1] :: gt*{gt}) -- Global_ok: `%|-%:%`(C, global, gt_1) -- Globals_ok: `%|-%*:%*`(C[GLOBAL_context =.. [gt_1]], global*{}, gt*{gt}) + + ;; 6-typing.watsup:1171.1-1172.17 + rule empty {C : context}: + `%|-%*:%*`(C, [], []) } ;; 6-typing.watsup:1127.1-1127.75 @@ -28174,15 +28317,15 @@ rec { ;; 6-typing.watsup:1127.1-1127.75 relation Types_ok: `%|-%*:%*`(context, type*, deftype*) - ;; 6-typing.watsup:1163.1-1164.17 - rule empty {C : context}: - `%|-%*:%*`(C, [], []) - ;; 6-typing.watsup:1166.1-1169.49 rule cons {C : context, dt* : deftype*, dt_1 : deftype, type* : type*, type_1 : type}: `%|-%*:%*`(C, [type_1] :: type*{type}, dt_1*{} :: dt*{dt}) -- Type_ok: `%|-%:%*`(C, type_1, [dt_1]) -- Types_ok: `%|-%*:%*`(C[TYPE_context =.. dt_1*{}], type*{type}, dt*{dt}) + + ;; 6-typing.watsup:1163.1-1164.17 + rule empty {C : context}: + `%|-%*:%*`(C, [], []) } ;; 6-typing.watsup:1126.1-1126.76 @@ -28215,19 +28358,19 @@ relation Module_ok: `|-%:OK`(module) ;; 7-runtime-typing.watsup:5.1-5.40 relation Ref_ok: `%|-%:%`(store, ref, reftype) - ;; 7-runtime-typing.watsup:7.1-8.35 - rule null {ht : heaptype, s : store}: - `%|-%:%`(s, REF.NULL_ref(ht), REF_reftype(`NULL%?`(?(())), ht)) + ;; 7-runtime-typing.watsup:28.1-29.45 + rule extern {addrref : addrref, s : store}: + `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) - ;; 7-runtime-typing.watsup:10.1-11.37 - rule i31 {i : nat, s : store}: - `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) + ;; 7-runtime-typing.watsup:25.1-26.39 + rule host {a : addr, s : store}: + `%|-%:%`(s, REF.HOST_ADDR_ref(a), REF_reftype(`NULL%?`(?()), ANY_heaptype)) - ;; 7-runtime-typing.watsup:13.1-15.30 - rule struct {a : addr, dt : deftype, s : store}: - `%|-%:%`(s, REF.STRUCT_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) - -- if (a < |s.STRUCT_store|) - -- if (s.STRUCT_store[a].TYPE_structinst = dt) + ;; 7-runtime-typing.watsup:21.1-23.28 + rule func {a : addr, dt : deftype, s : store}: + `%|-%:%`(s, REF.FUNC_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) + -- if (a < |s.FUNC_store|) + -- if (s.FUNC_store[a].TYPE_funcinst = dt) ;; 7-runtime-typing.watsup:17.1-19.29 rule array {a : addr, dt : deftype, s : store}: @@ -28235,476 +28378,477 @@ relation Ref_ok: `%|-%:%`(store, ref, reftype) -- if (a < |s.ARRAY_store|) -- if (s.ARRAY_store[a].TYPE_arrayinst = dt) - ;; 7-runtime-typing.watsup:21.1-23.28 - rule func {a : addr, dt : deftype, s : store}: - `%|-%:%`(s, REF.FUNC_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) - -- if (a < |s.FUNC_store|) - -- if (s.FUNC_store[a].TYPE_funcinst = dt) + ;; 7-runtime-typing.watsup:13.1-15.30 + rule struct {a : addr, dt : deftype, s : store}: + `%|-%:%`(s, REF.STRUCT_ADDR_ref(a), REF_reftype(`NULL%?`(?()), $heaptype_deftype(dt))) + -- if (a < |s.STRUCT_store|) + -- if (s.STRUCT_store[a].TYPE_structinst = dt) - ;; 7-runtime-typing.watsup:25.1-26.39 - rule host {a : addr, s : store}: - `%|-%:%`(s, REF.HOST_ADDR_ref(a), REF_reftype(`NULL%?`(?()), ANY_heaptype)) + ;; 7-runtime-typing.watsup:10.1-11.37 + rule i31 {i : nat, s : store}: + `%|-%:%`(s, REF.I31_NUM_ref(i), REF_reftype(`NULL%?`(?()), I31_heaptype)) - ;; 7-runtime-typing.watsup:28.1-29.45 - rule extern {addrref : addrref, s : store}: - `%|-%:%`(s, REF.EXTERN_ref(addrref), REF_reftype(`NULL%?`(?()), EXTERN_heaptype)) + ;; 7-runtime-typing.watsup:7.1-8.35 + rule null {ht : heaptype, s : store}: + `%|-%:%`(s, REF.NULL_ref(ht), REF_reftype(`NULL%?`(?(())), ht)) ;; 8-reduction.watsup:6.1-6.63 relation Step_pure: `%*~>%*`(admininstr*, admininstr*) - ;; 8-reduction.watsup:42.1-43.24 - rule unreachable: - `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) - - ;; 8-reduction.watsup:45.1-46.15 - rule nop: - `%*~>%*`([NOP_admininstr], []) - - ;; 8-reduction.watsup:48.1-49.20 - rule drop {val : val}: - `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) - - ;; 8-reduction.watsup:52.1-54.16 - rule select-true {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: - `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_1)]) - -- if (c =/= 0) - - ;; 8-reduction.watsup:56.1-58.14 - rule select-false {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: - `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_2)]) - -- if (c = 0) - - ;; 8-reduction.watsup:76.1-78.16 - rule if-true {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) - -- if (c =/= 0) + ;; 8-reduction.watsup:552.1-553.47 + rule local.tee {val : val, x : idx}: + `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) - ;; 8-reduction.watsup:80.1-82.14 - rule if-false {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) - -- if (c = 0) + ;; 8-reduction.watsup:539.1-540.55 + rule any.convert_extern-addr {addrref : addrref}: + `%*~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [$admininstr_addrref(addrref)]) - ;; 8-reduction.watsup:85.1-86.38 - rule label-vals {instr* : instr*, n : n, val* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) + ;; 8-reduction.watsup:536.1-537.55 + rule any.convert_extern-null {ht : heaptype}: + `%*~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) - ;; 8-reduction.watsup:92.1-93.69 - rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) + ;; 8-reduction.watsup:532.1-533.55 + rule extern.convert_any-addr {addrref : addrref}: + `%*~>%*`([$admininstr_addrref(addrref) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) - ;; 8-reduction.watsup:95.1-96.65 - rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: - `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) + ;; 8-reduction.watsup:529.1-530.58 + rule extern.convert_any-null {ht : heaptype}: + `%*~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) - ;; 8-reduction.watsup:99.1-101.16 - rule br_if-true {c : c, l : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) - -- if (c =/= 0) + ;; 8-reduction.watsup:311.1-312.68 + rule i31.get-num {i : nat, sx : sx}: + `%*~>%*`([REF.I31_NUM_admininstr(i) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, i))]) - ;; 8-reduction.watsup:103.1-105.14 - rule br_if-false {c : c, l : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) - -- if (c = 0) + ;; 8-reduction.watsup:308.1-309.39 + rule i31.get-null {ht : heaptype, sx : sx}: + `%*~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) - ;; 8-reduction.watsup:108.1-110.17 - rule br_table-lt {i : nat, l* : labelidx*, l' : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) - -- if (i < |l*{l}|) + ;; 8-reduction.watsup:281.1-283.15 + rule ref.eq-false {ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 0)]) + -- otherwise - ;; 8-reduction.watsup:112.1-114.18 - rule br_table-ge {i : nat, l* : labelidx*, l' : labelidx}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) - -- if (i >= |l*{l}|) + ;; 8-reduction.watsup:276.1-279.22 + rule ref.eq-true {ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- otherwise + -- if (ref_1 = ref_2) - ;; 8-reduction.watsup:117.1-119.26 - rule br_on_null-null {ht : heaptype, l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) - -- where REF.NULL_val(ht) = val + ;; 8-reduction.watsup:272.1-274.55 + rule ref.eq-null {ht_1 : heaptype, ht_2 : heaptype, ref_1 : ref, ref_2 : ref}: + `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) - ;; 8-reduction.watsup:121.1-123.15 - rule br_on_null-addr {l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [$admininstr_val(val)]) + ;; 8-reduction.watsup:267.1-269.15 + rule ref.as_non_null-addr {ref : ref}: + `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [$admininstr_ref(ref)]) -- otherwise - ;; 8-reduction.watsup:126.1-128.26 - rule br_on_non_null-null {ht : heaptype, l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], []) - -- where REF.NULL_val(ht) = val + ;; 8-reduction.watsup:263.1-265.28 + rule ref.as_non_null-null {ht : heaptype, ref : ref}: + `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) + -- where REF.NULL_ref(ht) = ref - ;; 8-reduction.watsup:130.1-132.15 - rule br_on_non_null-addr {l : labelidx, val : val}: - `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], [$admininstr_val(val) BR_admininstr(l)]) + ;; 8-reduction.watsup:258.1-260.15 + rule ref.is_null-false {val : val}: + `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) -- otherwise - ;; 8-reduction.watsup:186.1-187.84 - rule call_indirect-call {x : idx, y : idx}: - `%*~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) CALL_REF_admininstr(?(y))]) + ;; 8-reduction.watsup:254.1-256.28 + rule ref.is_null-true {ht : heaptype, val : val}: + `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) + -- where REF.NULL_val(ht) = val - ;; 8-reduction.watsup:189.1-190.98 - rule return_call_indirect {x : idx, y : idx}: - `%*~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) RETURN_CALL_REF_admininstr(?(y))]) + ;; 8-reduction.watsup:250.1-251.60 + rule ref.i31 {i : nat}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, i))]) - ;; 8-reduction.watsup:193.1-194.35 - rule frame-vals {f : frame, n : n, val^n : val^n}: - `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) + ;; 8-reduction.watsup:240.1-242.50 + rule cvtop-trap {c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: + `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) + -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = []) - ;; 8-reduction.watsup:196.1-197.55 - rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: - `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) + ;; 8-reduction.watsup:236.1-238.48 + rule cvtop-val {c : c, c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: + `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) + -- where [c] = $cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) - ;; 8-reduction.watsup:199.1-200.60 - rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: - `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) + ;; 8-reduction.watsup:232.1-233.70 + rule extend {c : c, n : n, nt : numtype, o0 : nat}: + `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, o0, S_sx, c))]) + -- where ?(o0) = $size($valtype_numtype(nt)) - ;; 8-reduction.watsup:205.1-207.33 - rule unop-val {c : c, c_1 : c, nt : numtype, unop : unop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) - -- where [c] = $unop(unop, nt, c_1) + ;; 8-reduction.watsup:227.1-229.40 + rule relop {c : c, c_1 : c, c_2 : c, nt : numtype, relop : relop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) + -- where c = $relop(relop, nt, c_1, c_2) - ;; 8-reduction.watsup:209.1-211.35 - rule unop-trap {c_1 : c, nt : numtype, unop : unop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) - -- if ($unop(unop, nt, c_1) = []) + ;; 8-reduction.watsup:223.1-225.37 + rule testop {c : c, c_1 : c, nt : numtype, testop : testop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) + -- where c = $testop(testop, nt, c_1) + + ;; 8-reduction.watsup:218.1-220.42 + rule binop-trap {binop : binop_numtype, c_1 : c, c_2 : c, nt : numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) + -- if ($binop(binop, nt, c_1, c_2) = []) ;; 8-reduction.watsup:214.1-216.40 rule binop-val {binop : binop_numtype, c : c, c_1 : c, c_2 : c, nt : numtype}: `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [CONST_admininstr(nt, c)]) -- where [c] = $binop(binop, nt, c_1, c_2) - ;; 8-reduction.watsup:218.1-220.42 - rule binop-trap {binop : binop_numtype, c_1 : c, c_2 : c, nt : numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) BINOP_admininstr(nt, binop)], [TRAP_admininstr]) - -- if ($binop(binop, nt, c_1, c_2) = []) + ;; 8-reduction.watsup:209.1-211.35 + rule unop-trap {c_1 : c, nt : numtype, unop : unop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [TRAP_admininstr]) + -- if ($unop(unop, nt, c_1) = []) - ;; 8-reduction.watsup:223.1-225.37 - rule testop {c : c, c_1 : c, nt : numtype, testop : testop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) TESTOP_admininstr(nt, testop)], [CONST_admininstr(I32_numtype, c)]) - -- where c = $testop(testop, nt, c_1) + ;; 8-reduction.watsup:205.1-207.33 + rule unop-val {c : c, c_1 : c, nt : numtype, unop : unop_numtype}: + `%*~>%*`([CONST_admininstr(nt, c_1) UNOP_admininstr(nt, unop)], [CONST_admininstr(nt, c)]) + -- where [c] = $unop(unop, nt, c_1) - ;; 8-reduction.watsup:227.1-229.40 - rule relop {c : c, c_1 : c, c_2 : c, nt : numtype, relop : relop_numtype}: - `%*~>%*`([CONST_admininstr(nt, c_1) CONST_admininstr(nt, c_2) RELOP_admininstr(nt, relop)], [CONST_admininstr(I32_numtype, c)]) - -- where c = $relop(relop, nt, c_1, c_2) + ;; 8-reduction.watsup:199.1-200.60 + rule return-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*}: + `%*~>%*`([LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [RETURN_admininstr]) - ;; 8-reduction.watsup:232.1-233.70 - rule extend {c : c, n : n, nt : numtype, o0 : nat}: - `%*~>%*`([CONST_admininstr(nt, c) EXTEND_admininstr(nt, n)], [CONST_admininstr(nt, $ext(n, o0, S_sx, c))]) - -- where ?(o0) = $size($valtype_numtype(nt)) + ;; 8-reduction.watsup:196.1-197.55 + rule return-frame {f : frame, instr* : instr*, n : n, val^n : val^n, val'* : val*}: + `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [RETURN_admininstr] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val}) - ;; 8-reduction.watsup:236.1-238.48 - rule cvtop-val {c : c, c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: - `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [CONST_admininstr(nt_2, c)]) - -- where [c] = $cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) + ;; 8-reduction.watsup:193.1-194.35 + rule frame-vals {f : frame, n : n, val^n : val^n}: + `%*~>%*`([FRAME__admininstr(n, f, $admininstr_val(val)^n{val})], $admininstr_val(val)^n{val}) - ;; 8-reduction.watsup:240.1-242.50 - rule cvtop-trap {c_1 : c, cvtop : cvtop, nt_1 : numtype, nt_2 : numtype, sx? : sx?}: - `%*~>%*`([CONST_admininstr(nt_1, c_1) CVTOP_admininstr(nt_2, cvtop, nt_1, sx?{sx})], [TRAP_admininstr]) - -- if ($cvtop(cvtop, nt_1, nt_2, sx?{sx}, c_1) = []) + ;; 8-reduction.watsup:189.1-190.98 + rule return_call_indirect {x : idx, y : idx}: + `%*~>%*`([RETURN_CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) RETURN_CALL_REF_admininstr(?(y))]) - ;; 8-reduction.watsup:250.1-251.60 - rule ref.i31 {i : nat}: - `%*~>%*`([CONST_admininstr(I32_numtype, i) REF.I31_admininstr], [REF.I31_NUM_admininstr($wrap(32, 31, i))]) + ;; 8-reduction.watsup:186.1-187.84 + rule call_indirect-call {x : idx, y : idx}: + `%*~>%*`([CALL_INDIRECT_admininstr(x, y)], [TABLE.GET_admininstr(x) REF.CAST_admininstr(REF_reftype(`NULL%?`(?(())), $heaptype_typevar($idx(y)))) CALL_REF_admininstr(?(y))]) - ;; 8-reduction.watsup:254.1-256.28 - rule ref.is_null-true {ht : heaptype, val : val}: - `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 1)]) + ;; 8-reduction.watsup:130.1-132.15 + rule br_on_non_null-addr {l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], [$admininstr_val(val) BR_admininstr(l)]) + -- otherwise + + ;; 8-reduction.watsup:126.1-128.26 + rule br_on_non_null-null {ht : heaptype, l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NON_NULL_admininstr(l)], []) -- where REF.NULL_val(ht) = val - ;; 8-reduction.watsup:258.1-260.15 - rule ref.is_null-false {val : val}: - `%*~>%*`([$admininstr_val(val) REF.IS_NULL_admininstr], [CONST_admininstr(I32_numtype, 0)]) + ;; 8-reduction.watsup:121.1-123.15 + rule br_on_null-addr {l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [$admininstr_val(val)]) -- otherwise - ;; 8-reduction.watsup:263.1-265.28 - rule ref.as_non_null-null {ht : heaptype, ref : ref}: - `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [TRAP_admininstr]) - -- where REF.NULL_ref(ht) = ref + ;; 8-reduction.watsup:117.1-119.26 + rule br_on_null-null {ht : heaptype, l : labelidx, val : val}: + `%*~>%*`([$admininstr_val(val) BR_ON_NULL_admininstr(l)], [BR_admininstr(l)]) + -- where REF.NULL_val(ht) = val - ;; 8-reduction.watsup:267.1-269.15 - rule ref.as_non_null-addr {ref : ref}: - `%*~>%*`([$admininstr_ref(ref) REF.AS_NON_NULL_admininstr], [$admininstr_ref(ref)]) - -- otherwise + ;; 8-reduction.watsup:112.1-114.18 + rule br_table-ge {i : nat, l* : labelidx*, l' : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l')]) + -- if (i >= |l*{l}|) - ;; 8-reduction.watsup:272.1-274.55 - rule ref.eq-null {ht_1 : heaptype, ht_2 : heaptype, ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) + ;; 8-reduction.watsup:108.1-110.17 + rule br_table-lt {i : nat, l* : labelidx*, l' : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, i) BR_TABLE_admininstr(l*{l}, l')], [BR_admininstr(l*{l}[i])]) + -- if (i < |l*{l}|) - ;; 8-reduction.watsup:276.1-279.22 - rule ref.eq-true {ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 1)]) - -- otherwise - -- if (ref_1 = ref_2) + ;; 8-reduction.watsup:103.1-105.14 + rule br_if-false {c : c, l : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], []) + -- if (c = 0) - ;; 8-reduction.watsup:281.1-283.15 - rule ref.eq-false {ref_1 : ref, ref_2 : ref}: - `%*~>%*`([$admininstr_ref(ref_1) $admininstr_ref(ref_2) REF.EQ_admininstr], [CONST_admininstr(I32_numtype, 0)]) - -- otherwise + ;; 8-reduction.watsup:99.1-101.16 + rule br_if-true {c : c, l : labelidx}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) BR_IF_admininstr(l)], [BR_admininstr(l)]) + -- if (c =/= 0) - ;; 8-reduction.watsup:308.1-309.39 - rule i31.get-null {ht : heaptype, sx : sx}: - `%*~>%*`([REF.NULL_admininstr(ht) I31.GET_admininstr(sx)], [TRAP_admininstr]) + ;; 8-reduction.watsup:95.1-96.65 + rule br-succ {instr* : instr*, instr'* : instr*, l : labelidx, n : n, val* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val)*{val} :: [BR_admininstr(l + 1)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)*{val} :: [BR_admininstr(l)]) - ;; 8-reduction.watsup:311.1-312.68 - rule i31.get-num {i : nat, sx : sx}: - `%*~>%*`([REF.I31_NUM_admininstr(i) I31.GET_admininstr(sx)], [CONST_admininstr(I32_numtype, $ext(31, 32, sx, i))]) + ;; 8-reduction.watsup:92.1-93.69 + rule br-zero {instr* : instr*, instr'* : instr*, n : n, val^n : val^n, val'* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr'*{instr'}, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [BR_admininstr(0)] :: $admininstr_instr(instr)*{instr})], $admininstr_val(val)^n{val} :: $admininstr_instr(instr')*{instr'}) - ;; 8-reduction.watsup:529.1-530.58 - rule extern.convert_any-null {ht : heaptype}: - `%*~>%*`([REF.NULL_admininstr(ht) EXTERN.CONVERT_ANY_admininstr], [REF.NULL_admininstr(EXTERN_heaptype)]) + ;; 8-reduction.watsup:85.1-86.38 + rule label-vals {instr* : instr*, n : n, val* : val*}: + `%*~>%*`([LABEL__admininstr(n, instr*{instr}, $admininstr_val(val)*{val})], $admininstr_val(val)*{val}) - ;; 8-reduction.watsup:532.1-533.55 - rule extern.convert_any-addr {addrref : addrref}: - `%*~>%*`([$admininstr_addrref(addrref) EXTERN.CONVERT_ANY_admininstr], [REF.EXTERN_admininstr(addrref)]) + ;; 8-reduction.watsup:80.1-82.14 + rule if-false {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_2*{instr_2})]) + -- if (c = 0) + + ;; 8-reduction.watsup:76.1-78.16 + rule if-true {bt : blocktype, c : c, instr_1* : instr*, instr_2* : instr*}: + `%*~>%*`([CONST_admininstr(I32_numtype, c) IF_admininstr(bt, instr_1*{instr_1}, instr_2*{instr_2})], [BLOCK_admininstr(bt, instr_1*{instr_1})]) + -- if (c =/= 0) + + ;; 8-reduction.watsup:56.1-58.14 + rule select-false {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: + `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_2)]) + -- if (c = 0) - ;; 8-reduction.watsup:536.1-537.55 - rule any.convert_extern-null {ht : heaptype}: - `%*~>%*`([REF.NULL_admininstr(ht) ANY.CONVERT_EXTERN_admininstr], [REF.NULL_admininstr(ANY_heaptype)]) + ;; 8-reduction.watsup:52.1-54.16 + rule select-true {c : c, t*? : valtype*?, val_1 : val, val_2 : val}: + `%*~>%*`([$admininstr_val(val_1) $admininstr_val(val_2) CONST_admininstr(I32_numtype, c) SELECT_admininstr(t*{t}?{t})], [$admininstr_val(val_1)]) + -- if (c =/= 0) - ;; 8-reduction.watsup:539.1-540.55 - rule any.convert_extern-addr {addrref : addrref}: - `%*~>%*`([REF.EXTERN_admininstr(addrref) ANY.CONVERT_EXTERN_admininstr], [$admininstr_addrref(addrref)]) + ;; 8-reduction.watsup:48.1-49.20 + rule drop {val : val}: + `%*~>%*`([$admininstr_val(val) DROP_admininstr], []) - ;; 8-reduction.watsup:552.1-553.47 - rule local.tee {val : val, x : idx}: - `%*~>%*`([$admininstr_val(val) LOCAL.TEE_admininstr(x)], [$admininstr_val(val) $admininstr_val(val) LOCAL.SET_admininstr(x)]) + ;; 8-reduction.watsup:45.1-46.15 + rule nop: + `%*~>%*`([NOP_admininstr], []) + + ;; 8-reduction.watsup:42.1-43.24 + rule unreachable: + `%*~>%*`([UNREACHABLE_admininstr], [TRAP_admininstr]) ;; 8-reduction.watsup:63.1-63.73 def blocktype : (state, blocktype) -> functype - ;; 8-reduction.watsup:64.1-64.44 - def {z : state} blocktype(z, _RESULT_blocktype(?())) = `%->%`([], []) - ;; 8-reduction.watsup:65.1-65.40 - def {t : valtype, z : state} blocktype(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) ;; 8-reduction.watsup:66.1-66.66 def {ft : functype, x : idx, z : state} blocktype(z, _IDX_blocktype(x)) = ft -- Expand: `%~~%`($type(z, x), FUNC_comptype(ft)) + ;; 8-reduction.watsup:65.1-65.40 + def {t : valtype, z : state} blocktype(z, _RESULT_blocktype(?(t))) = `%->%`([], [t]) + ;; 8-reduction.watsup:64.1-64.44 + def {z : state} blocktype(z, _RESULT_blocktype(?())) = `%->%`([], []) ;; 8-reduction.watsup:7.1-7.63 relation Step_read: `%~>%*`(config, admininstr*) - ;; 8-reduction.watsup:68.1-70.43 - rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) - -- where `%->%`(t_1^k{t_1}, t_2^n{t_2}) = $blocktype(z, bt) + ;; 8-reduction.watsup:753.1-757.15 + rule memory.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, y).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x, y)]) + -- otherwise + -- if (i < |$data(z, y).DATA_datainst|) - ;; 8-reduction.watsup:72.1-74.43 - rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) - -- where `%->%`(t_1^k{t_1}, t_2^n{t_2}) = $blocktype(z, bt) + ;; 8-reduction.watsup:748.1-751.14 + rule memory.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:135.1-138.66 - rule br_on_cast-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt) - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) + ;; 8-reduction.watsup:744.1-746.70 + rule memory.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) - ;; 8-reduction.watsup:140.1-142.15 - rule br_on_cast-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) + ;; 8-reduction.watsup:737.1-741.15 + rule memory.copy-gt {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) -- otherwise - ;; 8-reduction.watsup:145.1-148.66 - rule br_on_cast_fail-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt) - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) + ;; 8-reduction.watsup:730.1-735.19 + rule memory.copy-le {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, (i_1 + 1)) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) + -- otherwise + -- if (i_1 <= i_2) - ;; 8-reduction.watsup:150.1-152.15 - rule br_on_cast_fail-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) + ;; 8-reduction.watsup:725.1-728.14 + rule memory.copy-zero {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), []) -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:157.1-158.62 - rule call {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) CALL_REF_admininstr(?())]) - -- if (x < |$funcaddr(z)|) + ;; 8-reduction.watsup:721.1-723.77 + rule memory.copy-oob {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) - ;; 8-reduction.watsup:160.1-161.43 - rule call_ref-null {ht : heaptype, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) + ;; 8-reduction.watsup:714.1-718.15 + rule memory.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr(x)]) + -- otherwise - ;; 8-reduction.watsup:163.1-168.59 - rule call_ref-func {a : addr, f : frame, fi : funcinst, instr* : instr*, m : m, n : n, t* : valtype*, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, x? : idx?, y : idx, z : state}: - `%~>%*`(`%;%*`(z, $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], $admininstr_instr(instr)*{instr})])]) - -- if (a < |$funcinst(z)|) - -- where fi = $funcinst(z)[a] - -- where `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr}) = fi.CODE_funcinst - -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) + ;; 8-reduction.watsup:709.1-712.14 + rule memory.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:171.1-172.76 - rule return_call {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) RETURN_CALL_REF_admininstr(?())]) - -- if (x < |$funcaddr(z)|) + ;; 8-reduction.watsup:705.1-707.37 + rule memory.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:175.1-176.78 - rule return_call_ref-frame-null {f : frame, ht : heaptype, instr* : instr*, k : nat, val* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), [TRAP_admininstr]) + ;; 8-reduction.watsup:692.1-694.44 + rule memory.size {n : n, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) + -- where ((n * 64) * $Ki) = |$mem(z, x).DATA_meminst| - ;; 8-reduction.watsup:178.1-180.59 - rule return_call_ref-frame-addr {a : addr, f : frame, instr* : instr*, k : nat, m : m, n : n, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, val'* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) - -- if (a < |$funcinst(z)|) - -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + ;; 8-reduction.watsup:670.1-672.61 + rule load-pack-val {c : c, i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state, o0 : nat}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [CONST_admininstr(nt, $ext(n, o0, sx, c))]) + -- where ?(o0) = $size($valtype_numtype(nt)) + -- where $ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)] - ;; 8-reduction.watsup:182.1-183.91 - rule return_call_ref-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*, x? : idx?, z : state}: - `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) + ;; 8-reduction.watsup:666.1-668.51 + rule load-pack-oob {i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [TRAP_admininstr]) + -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:247.1-248.55 - rule ref.func {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) - -- if (x < |$funcaddr(z)|) + ;; 8-reduction.watsup:662.1-664.71 + rule load-num-val {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) + -- where ?(o0) = $size($valtype_numtype(nt)) + -- where $ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (o0 / 8)] - ;; 8-reduction.watsup:286.1-289.65 - rule ref.test-true {ref : ref, rt : reftype, rt' : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 1)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt') - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) + ;; 8-reduction.watsup:658.1-660.59 + rule load-num-oob {i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) + -- where ?(o0) = $size($valtype_numtype(nt)) + -- if (((i + mo.OFFSET_memop) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:291.1-293.15 - rule ref.test-false {ref : ref, rt : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 0)]) + ;; 8-reduction.watsup:645.1-649.15 + rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.INIT_admininstr(x, y)]) -- otherwise + -- if (i < |$elem(z, y).ELEM_eleminst|) - ;; 8-reduction.watsup:296.1-299.65 - rule ref.cast-succeed {ref : ref, rt : reftype, rt' : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [$admininstr_ref(ref)]) - -- Ref_ok: `%|-%:%`($store(z), ref, rt') - -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) - - ;; 8-reduction.watsup:301.1-303.15 - rule ref.cast-fail {ref : ref, rt : reftype, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:640.1-643.14 + rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), []) -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:322.1-325.43 - rule struct.new_default {mut* : mut*, val* : val*, x : idx, z : state, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)*{val} :: [STRUCT.NEW_admininstr(x)]) - -- if (|mut*{mut}| = |zt*{zt}|) - -- if (|val*{val}| = |zt*{zt}|) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} + ;; 8-reduction.watsup:636.1-638.72 + rule table.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) - ;; 8-reduction.watsup:328.1-329.50 - rule struct.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:629.1-633.15 + rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) + -- otherwise - ;; 8-reduction.watsup:331.1-334.41 - rule struct.get-struct {a : addr, i : nat, mut* : mut*, si : structinst, sx? : sx?, x : idx, z : state, zt* : storagetype*}: - `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [$admininstr_val($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]))]) - -- if (a < |$structinst(z)|) - -- where si = $structinst(z)[a] - -- if (i < |si.FIELD_structinst|) - -- if (|mut*{mut}| = |zt*{zt}|) - -- if (i < |zt*{zt}|) - -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + ;; 8-reduction.watsup:622.1-627.15 + rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) + -- otherwise + -- if (j <= i) - ;; 8-reduction.watsup:348.1-349.70 - rule array.new {n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.NEW_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + ;; 8-reduction.watsup:617.1-620.14 + rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:351.1-354.40 - rule array.new_default {mut : mut, n : n, val : val, x : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) ARRAY.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ($default($unpacktype(zt)) = ?(val)) + ;; 8-reduction.watsup:613.1-615.73 + rule table.copy-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) + -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) - ;; 8-reduction.watsup:362.1-364.38 - rule array.new_elem-oob {i : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) + ;; 8-reduction.watsup:606.1-610.15 + rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) + -- otherwise - ;; 8-reduction.watsup:366.1-368.40 - rule array.new_elem-alloc {i : nat, n : n, ref^n : ref^n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), $admininstr_ref(ref)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- where ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n] + ;; 8-reduction.watsup:601.1-604.14 + rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:371.1-374.59 - rule array.new_data-oob {i : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) + ;; 8-reduction.watsup:597.1-599.39 + rule table.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) + -- if ((i + n) > |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:376.1-380.88 - rule array.new_data-alloc {c^n : c^n, i : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (nt = $unpacknumtype(zt)) - -- if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) + ;; 8-reduction.watsup:584.1-586.32 + rule table.size {n : n, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) + -- where n = |$table(z, x).ELEM_tableinst| - ;; 8-reduction.watsup:383.1-384.61 - rule array.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:571.1-573.32 + rule table.get-val {i : nat, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) + -- if (i < |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:386.1-388.38 - rule array.get-oob {a : addr, i : nat, sx? : sx?, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) - -- if (a < |$arrayinst(z)|) - -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:567.1-569.33 + rule table.get-oob {i : nat, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) + -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:390.1-393.53 - rule array.get-array {a : addr, fv : fieldval, i : nat, mut : mut, sx? : sx?, x : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [$admininstr_val($unpackval(zt, sx?{sx}, fv))]) - -- if (i < |$arrayinst(z)[a].FIELD_arrayinst|) - -- if (a < |$arrayinst(z)|) - -- where fv = $arrayinst(z)[a].FIELD_arrayinst[i] - -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) + ;; 8-reduction.watsup:558.1-559.45 + rule global.get {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) - ;; 8-reduction.watsup:409.1-410.39 - rule array.len-null {ht : heaptype, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) + ;; 8-reduction.watsup:545.1-547.27 + rule local.get {val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val(val)]) + -- where ?(val) = $local(z, x) - ;; 8-reduction.watsup:412.1-414.37 - rule array.len-array {a : addr, n : n, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, n)]) - -- if (a < |$arrayinst(z)|) - -- where n = |$arrayinst(z)[a].FIELD_arrayinst| + ;; 8-reduction.watsup:517.1-524.67 + rule array.init_data-succ {a : addr, c : c, i : nat, j : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + ($storagesize(zt) / 8))) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_DATA_admininstr(x, y)]) + -- otherwise + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (nt = $unpacknumtype(zt)) + -- if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) - ;; 8-reduction.watsup:417.1-418.76 - rule array.fill-null {ht : heaptype, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:512.1-515.14 + rule array.init_data-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:420.1-422.44 - rule array.fill-oob {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:507.1-510.59 + rule array.init_data-oob2 {a : addr, i : nat, j : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) + + ;; 8-reduction.watsup:503.1-505.44 + rule array.init_data-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) -- if (a < |$arrayinst(z)|) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:424.1-427.14 - rule array.fill-zero {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:500.1-501.93 + rule array.init_data-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:429.1-433.15 - rule array.fill-succ {a : addr, i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.FILL_admininstr(x)]) + ;; 8-reduction.watsup:492.1-497.34 + rule array.init_elem-succ {a : addr, i : nat, j : nat, n : n, ref : ref, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_ELEM_admininstr(x, y)]) -- otherwise + -- if (j < |$elem(z, y).ELEM_eleminst|) + -- where ref = $elem(z, y).ELEM_eleminst[j] - ;; 8-reduction.watsup:435.1-436.102 - rule array.copy-null1 {ht_1 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, i_1) $admininstr_ref(ref) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:487.1-490.14 + rule array.init_elem-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:438.1-439.102 - rule array.copy-null2 {ht_2 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, i_1) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:483.1-485.38 + rule array.init_elem-oob2 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) - ;; 8-reduction.watsup:441.1-443.48 - rule array.copy-oob1 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if (a_1 < |$arrayinst(z)|) - -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) + ;; 8-reduction.watsup:479.1-481.44 + rule array.init_elem-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if (a < |$arrayinst(z)|) + -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:445.1-447.48 - rule array.copy-oob2 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if (a_2 < |$arrayinst(z)|) - -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) + ;; 8-reduction.watsup:476.1-477.93 + rule array.init_elem-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:449.1-452.14 - rule array.copy-zero {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), []) + ;; 8-reduction.watsup:465.1-473.29 + rule array.copy-gt {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) -- otherwise - -- if (n = 0) + -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) + -- if (sx?{sx} = $sxfield(zt_2)) ;; 8-reduction.watsup:454.1-463.19 rule array.copy-le {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: @@ -28714,370 +28858,369 @@ relation Step_read: `%~>%*`(config, admininstr*) -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) -- if (sx?{sx} = $sxfield(zt_2)) - ;; 8-reduction.watsup:465.1-473.29 - rule array.copy-gt {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, mut : mut, n : n, sx? : sx?, x_1 : idx, x_2 : idx, z : state, zt_2 : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) ARRAY.GET_admininstr(sx?{sx}, x_2) ARRAY.SET_admininstr(x_1) REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.COPY_admininstr(x_1, x_2)]) + ;; 8-reduction.watsup:449.1-452.14 + rule array.copy-zero {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), []) -- otherwise - -- Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) - -- if (sx?{sx} = $sxfield(zt_2)) + -- if (n = 0) - ;; 8-reduction.watsup:476.1-477.93 - rule array.init_elem-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:445.1-447.48 + rule array.copy-oob2 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if (a_2 < |$arrayinst(z)|) + -- if ((i_2 + n) > |$arrayinst(z)[a_2].FIELD_arrayinst|) - ;; 8-reduction.watsup:479.1-481.44 - rule array.init_elem-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if (a < |$arrayinst(z)|) - -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:441.1-443.48 + rule array.copy-oob1 {a_1 : addr, a_2 : addr, i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a_1) CONST_admininstr(I32_numtype, i_1) REF.ARRAY_ADDR_admininstr(a_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) + -- if (a_1 < |$arrayinst(z)|) + -- if ((i_1 + n) > |$arrayinst(z)[a_1].FIELD_arrayinst|) - ;; 8-reduction.watsup:483.1-485.38 - rule array.init_elem-oob2 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [TRAP_admininstr]) - -- if ((j + n) > |$elem(z, y).ELEM_eleminst|) + ;; 8-reduction.watsup:438.1-439.102 + rule array.copy-null2 {ht_2 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, i_1) REF.NULL_admininstr(ht_2) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:487.1-490.14 - rule array.init_elem-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:435.1-436.102 + rule array.copy-null1 {ht_1 : heaptype, i_1 : nat, i_2 : nat, n : n, ref : ref, x_1 : idx, x_2 : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht_1) CONST_admininstr(I32_numtype, i_1) $admininstr_ref(ref) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) ARRAY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:492.1-497.34 - rule array.init_elem-succ {a : addr, i : nat, j : nat, n : n, ref : ref, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_ELEM_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_ELEM_admininstr(x, y)]) + ;; 8-reduction.watsup:429.1-433.15 + rule array.fill-succ {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.FILL_admininstr(x)]) -- otherwise - -- if (j < |$elem(z, y).ELEM_eleminst|) - -- where ref = $elem(z, y).ELEM_eleminst[j] - ;; 8-reduction.watsup:500.1-501.93 - rule array.init_data-null {ht : heaptype, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:424.1-427.14 + rule array.fill-zero {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), []) + -- otherwise + -- if (n = 0) - ;; 8-reduction.watsup:503.1-505.44 - rule array.init_data-oob1 {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) + ;; 8-reduction.watsup:420.1-422.44 + rule array.fill-oob {a : addr, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) -- if (a < |$arrayinst(z)|) -- if ((i + n) > |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:507.1-510.59 - rule array.init_data-oob2 {a : addr, i : nat, j : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [TRAP_admininstr]) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) - - ;; 8-reduction.watsup:512.1-515.14 - rule array.init_data-zero {a : addr, i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:417.1-418.76 + rule array.fill-null {ht : heaptype, i : nat, n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.FILL_admininstr(x)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:517.1-524.67 - rule array.init_data-succ {a : addr, c : c, i : nat, j : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: - `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, n) ARRAY.INIT_DATA_admininstr(x, y)]), [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) ARRAY.SET_admininstr(x) REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (j + ($storagesize(zt) / 8))) CONST_admininstr(I32_numtype, (n - 1)) ARRAY.INIT_DATA_admininstr(x, y)]) - -- otherwise - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (nt = $unpacknumtype(zt)) - -- if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) + ;; 8-reduction.watsup:412.1-414.37 + rule array.len-array {a : addr, n : n, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) ARRAY.LEN_admininstr]), [CONST_admininstr(I32_numtype, n)]) + -- if (a < |$arrayinst(z)|) + -- where n = |$arrayinst(z)[a].FIELD_arrayinst| - ;; 8-reduction.watsup:545.1-547.27 - rule local.get {val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [LOCAL.GET_admininstr(x)]), [$admininstr_val(val)]) - -- where ?(val) = $local(z, x) + ;; 8-reduction.watsup:409.1-410.39 + rule array.len-null {ht : heaptype, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) ARRAY.LEN_admininstr]), [TRAP_admininstr]) - ;; 8-reduction.watsup:558.1-559.45 - rule global.get {x : idx, z : state}: - `%~>%*`(`%;%*`(z, [GLOBAL.GET_admininstr(x)]), [$admininstr_val($global(z, x).VALUE_globalinst)]) + ;; 8-reduction.watsup:390.1-393.53 + rule array.get-array {a : addr, fv : fieldval, i : nat, mut : mut, sx? : sx?, x : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [$admininstr_val($unpackval(zt, sx?{sx}, fv))]) + -- if (i < |$arrayinst(z)[a].FIELD_arrayinst|) + -- if (a < |$arrayinst(z)|) + -- where fv = $arrayinst(z)[a].FIELD_arrayinst[i] + -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) - ;; 8-reduction.watsup:567.1-569.33 - rule table.get-oob {i : nat, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [TRAP_admininstr]) - -- if (i >= |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:386.1-388.38 + rule array.get-oob {a : addr, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) + -- if (a < |$arrayinst(z)|) + -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:571.1-573.32 - rule table.get-val {i : nat, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(x)]), [$admininstr_ref($table(z, x).ELEM_tableinst[i])]) - -- if (i < |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:383.1-384.61 + rule array.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) ARRAY.GET_admininstr(sx?{sx}, x)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:584.1-586.32 - rule table.size {n : n, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [TABLE.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) - -- where n = |$table(z, x).ELEM_tableinst| + ;; 8-reduction.watsup:376.1-380.88 + rule array.new_data-alloc {c^n : c^n, i : nat, mut : mut, n : n, nt : numtype, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), CONST_admininstr(nt, c)^n{c} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (nt = $unpacknumtype(zt)) + -- if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) - ;; 8-reduction.watsup:597.1-599.39 - rule table.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:371.1-374.59 + rule array.new_data-oob {i : nat, mut : mut, n : n, x : idx, y : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_DATA_admininstr(x, y)]), [TRAP_admininstr]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) - ;; 8-reduction.watsup:601.1-604.14 - rule table.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:366.1-368.40 + rule array.new_elem-alloc {i : nat, n : n, ref^n : ref^n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), $admininstr_ref(ref)^n{ref} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- where ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n] - ;; 8-reduction.watsup:606.1-610.15 - rule table.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) TABLE.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) TABLE.FILL_admininstr(x)]) - -- otherwise + ;; 8-reduction.watsup:362.1-364.38 + rule array.new_elem-oob {i : nat, n : n, x : idx, y : idx, z : state}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) ARRAY.NEW_ELEM_admininstr(x, y)]), [TRAP_admininstr]) + -- if ((i + n) > |$elem(z, y).ELEM_eleminst|) - ;; 8-reduction.watsup:613.1-615.73 - rule table.copy-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$table(z, y).ELEM_tableinst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) + ;; 8-reduction.watsup:351.1-354.40 + rule array.new_default {mut : mut, n : n, val : val, x : idx, z : state, zt : storagetype}: + `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) ARRAY.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if ($default($unpacktype(zt)) = ?(val)) - ;; 8-reduction.watsup:617.1-620.14 - rule table.copy-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:348.1-349.70 + rule array.new {n : n, val : val, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_val(val) CONST_admininstr(I32_numtype, n) ARRAY.NEW_admininstr(x)]), $admininstr_val(val)^n{} :: [ARRAY.NEW_FIXED_admininstr(x, n)]) - ;; 8-reduction.watsup:622.1-627.15 - rule table.copy-le {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) - -- otherwise - -- if (j <= i) + ;; 8-reduction.watsup:331.1-334.41 + rule struct.get-struct {a : addr, i : nat, mut* : mut*, si : structinst, sx? : sx?, x : idx, z : state, zt* : storagetype*}: + `%~>%*`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [$admininstr_val($unpackval(zt*{zt}[i], sx?{sx}, si.FIELD_structinst[i]))]) + -- if (a < |$structinst(z)|) + -- where si = $structinst(z)[a] + -- if (i < |si.FIELD_structinst|) + -- if (|mut*{mut}| = |zt*{zt}|) + -- if (i < |zt*{zt}|) + -- Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - ;; 8-reduction.watsup:629.1-633.15 - rule table.copy-gt {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.COPY_admininstr(x, y)]), [CONST_admininstr(I32_numtype, ((j + n) - 1)) CONST_admininstr(I32_numtype, ((i + n) - 1)) TABLE.GET_admininstr(y) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, (n - 1)) TABLE.COPY_admininstr(x, y)]) - -- otherwise + ;; 8-reduction.watsup:328.1-329.50 + rule struct.get-null {ht : heaptype, i : nat, sx? : sx?, x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) STRUCT.GET_admininstr(sx?{sx}, x, i)]), [TRAP_admininstr]) - ;; 8-reduction.watsup:636.1-638.72 - rule table.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$elem(z, y).ELEM_eleminst|) \/ ((j + n) > |$table(z, x).ELEM_tableinst|)) + ;; 8-reduction.watsup:322.1-325.43 + rule struct.new_default {mut* : mut*, val* : val*, x : idx, z : state, zt* : storagetype*}: + `%~>%*`(`%;%*`(z, [STRUCT.NEW_DEFAULT_admininstr(x)]), $admininstr_val(val)*{val} :: [STRUCT.NEW_admininstr(x)]) + -- if (|mut*{mut}| = |zt*{zt}|) + -- if (|val*{val}| = |zt*{zt}|) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- (if ($default($unpacktype(zt)) = ?(val)))*{val zt} - ;; 8-reduction.watsup:640.1-643.14 - rule table.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), []) + ;; 8-reduction.watsup:301.1-303.15 + rule ref.cast-fail {ref : ref, rt : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [TRAP_admininstr]) -- otherwise - -- if (n = 0) - ;; 8-reduction.watsup:645.1-649.15 - rule table.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) TABLE.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) $admininstr_ref($elem(z, y).ELEM_eleminst[i]) TABLE.SET_admininstr(x) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) TABLE.INIT_admininstr(x, y)]) + ;; 8-reduction.watsup:296.1-299.65 + rule ref.cast-succeed {ref : ref, rt : reftype, rt' : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.CAST_admininstr(rt)]), [$admininstr_ref(ref)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt') + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) + + ;; 8-reduction.watsup:291.1-293.15 + rule ref.test-false {ref : ref, rt : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 0)]) -- otherwise - -- if (i < |$elem(z, y).ELEM_eleminst|) - ;; 8-reduction.watsup:658.1-660.59 - rule load-num-oob {i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [TRAP_admininstr]) - -- where ?(o0) = $size($valtype_numtype(nt)) - -- if (((i + mo.OFFSET_memop) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:286.1-289.65 + rule ref.test-true {ref : ref, rt : reftype, rt' : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) REF.TEST_admininstr(rt)]), [CONST_admininstr(I32_numtype, 1)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt') + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) - ;; 8-reduction.watsup:662.1-664.71 - rule load-num-val {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?(), x, mo)]), [CONST_admininstr(nt, c)]) - -- where ?(o0) = $size($valtype_numtype(nt)) - -- where $ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (o0 / 8)] + ;; 8-reduction.watsup:247.1-248.55 + rule ref.func {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [REF.FUNC_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x])]) + -- if (x < |$funcaddr(z)|) - ;; 8-reduction.watsup:666.1-668.51 - rule load-pack-oob {i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [TRAP_admininstr]) - -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:182.1-183.91 + rule return_call_ref-label {instr* : instr*, instr'* : instr*, k : nat, val* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [LABEL__admininstr(k, instr'*{instr'}, $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)*{val} :: [RETURN_CALL_REF_admininstr(x?{x})]) - ;; 8-reduction.watsup:670.1-672.61 - rule load-pack-val {c : c, i : nat, mo : memop, n : n, nt : numtype, sx : sx, x : idx, z : state, o0 : nat}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) LOAD_admininstr(nt, ?((n, sx)), x, mo)]), [CONST_admininstr(nt, $ext(n, o0, sx, c))]) - -- where ?(o0) = $size($valtype_numtype(nt)) - -- where $ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)] + ;; 8-reduction.watsup:178.1-180.59 + rule return_call_ref-frame-addr {a : addr, f : frame, instr* : instr*, k : nat, m : m, n : n, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, val'* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val')*{val'} :: $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]) + -- if (a < |$funcinst(z)|) + -- Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) - ;; 8-reduction.watsup:692.1-694.44 - rule memory.size {n : n, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [MEMORY.SIZE_admininstr(x)]), [CONST_admininstr(I32_numtype, n)]) - -- where ((n * 64) * $Ki) = |$mem(z, x).DATA_meminst| + ;; 8-reduction.watsup:175.1-176.78 + rule return_call_ref-frame-null {f : frame, ht : heaptype, instr* : instr*, k : nat, val* : val*, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [FRAME__admininstr(k, f, $admininstr_val(val)*{val} :: [REF.NULL_admininstr(ht)] :: [RETURN_CALL_REF_admininstr(x?{x})] :: $admininstr_instr(instr)*{instr})]), [TRAP_admininstr]) - ;; 8-reduction.watsup:705.1-707.37 - rule memory.fill-oob {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [TRAP_admininstr]) - -- if ((i + n) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:171.1-172.76 + rule return_call {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [RETURN_CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) RETURN_CALL_REF_admininstr(?())]) + -- if (x < |$funcaddr(z)|) - ;; 8-reduction.watsup:709.1-712.14 - rule memory.fill-zero {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:163.1-168.59 + rule call_ref-func {a : addr, f : frame, fi : funcinst, instr* : instr*, m : m, n : n, t* : valtype*, t_1^n : valtype^n, t_2^m : valtype^m, val^n : val^n, x? : idx?, y : idx, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^n{val} :: [REF.FUNC_ADDR_admininstr(a) CALL_REF_admininstr(x?{x})]), [FRAME__admininstr(m, f, [LABEL__admininstr(m, [], $admininstr_instr(instr)*{instr})])]) + -- if (a < |$funcinst(z)|) + -- where fi = $funcinst(z)[a] + -- where `FUNC%%*%`(y, LOCAL(t)*{t}, instr*{instr}) = fi.CODE_funcinst + -- Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) + -- if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) - ;; 8-reduction.watsup:714.1-718.15 - rule memory.fill-succ {i : nat, n : n, val : val, x : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_val(val) CONST_admininstr(I32_numtype, n) MEMORY.FILL_admininstr(x)]), [CONST_admininstr(I32_numtype, i) $admininstr_val(val) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (i + 1)) $admininstr_val(val) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.FILL_admininstr(x)]) - -- otherwise + ;; 8-reduction.watsup:160.1-161.43 + rule call_ref-null {ht : heaptype, x? : idx?, z : state}: + `%~>%*`(`%;%*`(z, [REF.NULL_admininstr(ht) CALL_REF_admininstr(x?{x})]), [TRAP_admininstr]) - ;; 8-reduction.watsup:721.1-723.77 - rule memory.copy-oob {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [TRAP_admininstr]) - -- if (((i_1 + n) > |$mem(z, x_1).DATA_meminst|) \/ ((i_2 + n) > |$mem(z, x_2).DATA_meminst|)) + ;; 8-reduction.watsup:157.1-158.62 + rule call {x : idx, z : state}: + `%~>%*`(`%;%*`(z, [CALL_admininstr(x)]), [REF.FUNC_ADDR_admininstr($funcaddr(z)[x]) CALL_REF_admininstr(?())]) + -- if (x < |$funcaddr(z)|) - ;; 8-reduction.watsup:725.1-728.14 - rule memory.copy-zero {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), []) + ;; 8-reduction.watsup:150.1-152.15 + rule br_on_cast_fail-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) -- otherwise - -- if (n = 0) - ;; 8-reduction.watsup:730.1-735.19 - rule memory.copy-le {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, (i_1 + 1)) CONST_admininstr(I32_numtype, (i_2 + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) - -- otherwise - -- if (i_1 <= i_2) + ;; 8-reduction.watsup:145.1-148.66 + rule br_on_cast_fail-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_FAIL_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt) + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) - ;; 8-reduction.watsup:737.1-741.15 - rule memory.copy-gt {i_1 : nat, i_2 : nat, n : n, x_1 : idx, x_2 : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, n) MEMORY.COPY_admininstr(x_1, x_2)]), [CONST_admininstr(I32_numtype, ((i_1 + n) - 1)) CONST_admininstr(I32_numtype, ((i_2 + n) - 1)) LOAD_admininstr(I32_numtype, ?((8, U_sx)), x_2, $memop0) STORE_admininstr(I32_numtype, ?(8), x_1, $memop0) CONST_admininstr(I32_numtype, i_1) CONST_admininstr(I32_numtype, i_2) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.COPY_admininstr(x_1, x_2)]) + ;; 8-reduction.watsup:140.1-142.15 + rule br_on_cast-fail {l : labelidx, ref : ref, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref)]) -- otherwise - ;; 8-reduction.watsup:744.1-746.70 - rule memory.init-oob {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [TRAP_admininstr]) - -- if (((i + n) > |$data(z, y).DATA_datainst|) \/ ((j + n) > |$mem(z, x).DATA_meminst|)) + ;; 8-reduction.watsup:135.1-138.66 + rule br_on_cast-succeed {l : labelidx, ref : ref, rt : reftype, rt_1 : reftype, rt_2 : reftype, z : state}: + `%~>%*`(`%;%*`(z, [$admininstr_ref(ref) BR_ON_CAST_admininstr(l, rt_1, rt_2)]), [$admininstr_ref(ref) BR_admininstr(l)]) + -- Ref_ok: `%|-%:%`($store(z), ref, rt) + -- Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) - ;; 8-reduction.watsup:748.1-751.14 - rule memory.init-zero {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), []) - -- otherwise - -- if (n = 0) + ;; 8-reduction.watsup:72.1-74.43 + rule loop {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [LOOP_admininstr(bt, instr*{instr})]), [LABEL__admininstr(k, [LOOP_instr(bt, instr*{instr})], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) + -- where `%->%`(t_1^k{t_1}, t_2^n{t_2}) = $blocktype(z, bt) - ;; 8-reduction.watsup:753.1-757.15 - rule memory.init-succ {i : nat, j : nat, n : n, x : idx, y : idx, z : state}: - `%~>%*`(`%;%*`(z, [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, i) CONST_admininstr(I32_numtype, n) MEMORY.INIT_admininstr(x, y)]), [CONST_admininstr(I32_numtype, j) CONST_admininstr(I32_numtype, $data(z, y).DATA_datainst[i]) STORE_admininstr(I32_numtype, ?(8), x, $memop0) CONST_admininstr(I32_numtype, (j + 1)) CONST_admininstr(I32_numtype, (i + 1)) CONST_admininstr(I32_numtype, (n - 1)) MEMORY.INIT_admininstr(x, y)]) - -- otherwise - -- if (i < |$data(z, y).DATA_datainst|) + ;; 8-reduction.watsup:68.1-70.43 + rule block {bt : blocktype, instr* : instr*, k : nat, n : n, t_1^k : valtype^k, t_2^n : valtype^n, val^k : val^k, z : state}: + `%~>%*`(`%;%*`(z, $admininstr_val(val)^k{val} :: [BLOCK_admininstr(bt, instr*{instr})]), [LABEL__admininstr(n, [], $admininstr_val(val)^k{val} :: $admininstr_instr(instr)*{instr})]) + -- where `%->%`(t_1^k{t_1}, t_2^n{t_2}) = $blocktype(z, bt) ;; 8-reduction.watsup:5.1-5.63 relation Step: `%~>%`(config, config) - ;; 8-reduction.watsup:10.1-12.34 - rule pure {instr* : instr*, instr'* : instr*, z : state}: - `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) - -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) + ;; 8-reduction.watsup:760.1-761.51 + rule data.drop {x : idx, z : state}: + `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) - ;; 8-reduction.watsup:14.1-16.37 - rule read {instr* : instr*, instr'* : instr*, z : state}: - `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) - -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) + ;; 8-reduction.watsup:701.1-702.77 + rule memory.grow-fail {n : n, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) - ;; 8-reduction.watsup:317.1-320.61 - rule struct.new {mut^n : mut^n, n : n, si : structinst, val^n : val^n, x : idx, z : state, zt^n : storagetype^n}: - `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) - -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) - -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) + ;; 8-reduction.watsup:697.1-699.40 + rule memory.grow-succeed {mi : meminst, n : n, x : idx, z : state, o0 : meminst}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, (|$mem(z, x).DATA_meminst| / (64 * $Ki)))])) + -- where ?(o0) = $growmemory($mem(z, x), n) + -- where mi = o0 - ;; 8-reduction.watsup:337.1-338.53 - rule struct.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`(z, [TRAP_admininstr])) + ;; 8-reduction.watsup:687.1-689.48 + rule store-pack-val {b* : byte*, c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (n / 8), b*{b}), [])) + -- where ?(o0) = $size($valtype_numtype(nt)) + -- where b*{b} = $ibytes(n, $wrap(o0, n, c)) - ;; 8-reduction.watsup:340.1-343.35 - rule struct.set-struct {a : addr, fv : fieldval, i : nat, mut* : mut*, val : val, x : idx, z : state, zt* : storagetype*}: - `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`($with_struct(z, a, i, fv), [])) - -- if (a < |$structinst(z)|) - -- if (|mut*{mut}| = |zt*{zt}|) - -- if (i < |zt*{zt}|) - -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) - -- if (fv = $packval(zt*{zt}[i], val)) + ;; 8-reduction.watsup:683.1-685.51 + rule store-pack-oob {c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:356.1-359.61 - rule array.new_fixed {ai : arrayinst, mut : mut, n : n, val^n : val^n, x : idx, z : state, zt : storagetype}: - `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) - -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) - -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) + ;; 8-reduction.watsup:679.1-681.29 + rule store-num-val {b* : byte*, c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (o0 / 8), b*{b}), [])) + -- where ?(o0) = $size($valtype_numtype(nt)) + -- where b*{b} = $ntbytes(nt, c) - ;; 8-reduction.watsup:396.1-397.64 - rule array.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + ;; 8-reduction.watsup:675.1-677.59 + rule store-num-oob {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) + -- where ?(o0) = $size($valtype_numtype(nt)) + -- if (((i + mo.OFFSET_memop) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) - ;; 8-reduction.watsup:399.1-401.38 - rule array.set-oob {a : addr, i : nat, val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) - -- if (a < |$arrayinst(z)|) - -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) + ;; 8-reduction.watsup:652.1-653.51 + rule elem.drop {x : idx, z : state}: + `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) - ;; 8-reduction.watsup:403.1-406.31 - rule array.set-array {a : addr, fv : fieldval, i : nat, mut : mut, val : val, x : idx, z : state, zt : storagetype}: - `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) - -- if (a < |$arrayinst(z)|) - -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) - -- if (fv = $packval(zt, val)) + ;; 8-reduction.watsup:593.1-594.80 + rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) - ;; 8-reduction.watsup:549.1-550.56 - rule local.set {val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) + ;; 8-reduction.watsup:589.1-591.46 + rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state, o0 : tableinst}: + `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) + -- where ?(o0) = $growtable($table(z, x), n, ref) + -- where ti = o0 - ;; 8-reduction.watsup:561.1-562.58 - rule global.set {val : val, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) + ;; 8-reduction.watsup:579.1-581.32 + rule table.set-val {i : nat, ref : ref, x : idx, z : state}: + `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) + -- if (i < |$table(z, x).ELEM_tableinst|) ;; 8-reduction.watsup:575.1-577.33 rule table.set-oob {i : nat, ref : ref, x : idx, z : state}: `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) -- if (i >= |$table(z, x).ELEM_tableinst|) - ;; 8-reduction.watsup:579.1-581.32 - rule table.set-val {i : nat, ref : ref, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) $admininstr_ref(ref) TABLE.SET_admininstr(x)]), `%;%*`($with_table(z, x, i, ref), [])) - -- if (i < |$table(z, x).ELEM_tableinst|) + ;; 8-reduction.watsup:561.1-562.58 + rule global.set {val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_val(val) GLOBAL.SET_admininstr(x)]), `%;%*`($with_global(z, x, val), [])) - ;; 8-reduction.watsup:589.1-591.46 - rule table.grow-succeed {n : n, ref : ref, ti : tableinst, x : idx, z : state, o0 : tableinst}: - `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`($with_tableinst(z, x, ti), [CONST_admininstr(I32_numtype, |$table(z, x).ELEM_tableinst|)])) - -- where ?(o0) = $growtable($table(z, x), n, ref) - -- where ti = o0 + ;; 8-reduction.watsup:549.1-550.56 + rule local.set {val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [$admininstr_val(val) LOCAL.SET_admininstr(x)]), `%;%*`($with_local(z, x, val), [])) - ;; 8-reduction.watsup:593.1-594.80 - rule table.grow-fail {n : n, ref : ref, x : idx, z : state}: - `%~>%`(`%;%*`(z, [$admininstr_ref(ref) CONST_admininstr(I32_numtype, n) TABLE.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) + ;; 8-reduction.watsup:403.1-406.31 + rule array.set-array {a : addr, fv : fieldval, i : nat, mut : mut, val : val, x : idx, z : state, zt : storagetype}: + `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`($with_array(z, a, i, fv), [])) + -- if (a < |$arrayinst(z)|) + -- Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) + -- if (fv = $packval(zt, val)) - ;; 8-reduction.watsup:652.1-653.51 - rule elem.drop {x : idx, z : state}: - `%~>%`(`%;%*`(z, [ELEM.DROP_admininstr(x)]), `%;%*`($with_elem(z, x, []), [])) + ;; 8-reduction.watsup:399.1-401.38 + rule array.set-oob {a : addr, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.ARRAY_ADDR_admininstr(a) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) + -- if (a < |$arrayinst(z)|) + -- if (i >= |$arrayinst(z)[a].FIELD_arrayinst|) - ;; 8-reduction.watsup:675.1-677.59 - rule store-num-oob {c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- where ?(o0) = $size($valtype_numtype(nt)) - -- if (((i + mo.OFFSET_memop) + (o0 / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:396.1-397.64 + rule array.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) CONST_admininstr(I32_numtype, i) $admininstr_val(val) ARRAY.SET_admininstr(x)]), `%;%*`(z, [TRAP_admininstr])) - ;; 8-reduction.watsup:679.1-681.29 - rule store-num-val {b* : byte*, c : c, i : nat, mo : memop, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (o0 / 8), b*{b}), [])) - -- where ?(o0) = $size($valtype_numtype(nt)) - -- where b*{b} = $ntbytes(nt, c) + ;; 8-reduction.watsup:356.1-359.61 + rule array.new_fixed {ai : arrayinst, mut : mut, n : n, val^n : val^n, x : idx, z : state, zt : storagetype}: + `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [ARRAY.NEW_FIXED_admininstr(x, n)]), `%;%*`($ext_arrayinst(z, [ai]), [REF.ARRAY_ADDR_admininstr(|$arrayinst(z)|)])) + -- Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) + -- if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) - ;; 8-reduction.watsup:683.1-685.51 - rule store-pack-oob {c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`(z, [TRAP_admininstr])) - -- if (((i + mo.OFFSET_memop) + (n / 8)) > |$mem(z, x).DATA_meminst|) + ;; 8-reduction.watsup:340.1-343.35 + rule struct.set-struct {a : addr, fv : fieldval, i : nat, mut* : mut*, val : val, x : idx, z : state, zt* : storagetype*}: + `%~>%`(`%;%*`(z, [REF.STRUCT_ADDR_admininstr(a) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`($with_struct(z, a, i, fv), [])) + -- if (a < |$structinst(z)|) + -- if (|mut*{mut}| = |zt*{zt}|) + -- if (i < |zt*{zt}|) + -- Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) + -- if (fv = $packval(zt*{zt}[i], val)) - ;; 8-reduction.watsup:687.1-689.48 - rule store-pack-val {b* : byte*, c : c, i : nat, mo : memop, n : n, nt : numtype, x : idx, z : state, o0 : nat}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, i) CONST_admininstr(nt, c) STORE_admininstr(nt, ?(n), x, mo)]), `%;%*`($with_mem(z, x, (i + mo.OFFSET_memop), (n / 8), b*{b}), [])) - -- where ?(o0) = $size($valtype_numtype(nt)) - -- where b*{b} = $ibytes(n, $wrap(o0, n, c)) + ;; 8-reduction.watsup:337.1-338.53 + rule struct.set-null {ht : heaptype, i : nat, val : val, x : idx, z : state}: + `%~>%`(`%;%*`(z, [REF.NULL_admininstr(ht) $admininstr_val(val) STRUCT.SET_admininstr(x, i)]), `%;%*`(z, [TRAP_admininstr])) - ;; 8-reduction.watsup:697.1-699.40 - rule memory.grow-succeed {mi : meminst, n : n, x : idx, z : state, o0 : meminst}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`($with_meminst(z, x, mi), [CONST_admininstr(I32_numtype, (|$mem(z, x).DATA_meminst| / (64 * $Ki)))])) - -- where ?(o0) = $growmemory($mem(z, x), n) - -- where mi = o0 + ;; 8-reduction.watsup:317.1-320.61 + rule struct.new {mut^n : mut^n, n : n, si : structinst, val^n : val^n, x : idx, z : state, zt^n : storagetype^n}: + `%~>%`(`%;%*`(z, $admininstr_val(val)^n{val} :: [STRUCT.NEW_admininstr(x)]), `%;%*`($ext_structinst(z, [si]), [REF.STRUCT_ADDR_admininstr(|$structinst(z)|)])) + -- Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) + -- if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) - ;; 8-reduction.watsup:701.1-702.77 - rule memory.grow-fail {n : n, x : idx, z : state}: - `%~>%`(`%;%*`(z, [CONST_admininstr(I32_numtype, n) MEMORY.GROW_admininstr(x)]), `%;%*`(z, [CONST_admininstr(I32_numtype, $invsigned(32, - (1 <: int)))])) + ;; 8-reduction.watsup:14.1-16.37 + rule read {instr* : instr*, instr'* : instr*, z : state}: + `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) + -- Step_read: `%~>%*`(`%;%*`(z, $admininstr_instr(instr)*{instr}), $admininstr_instr(instr')*{instr'}) - ;; 8-reduction.watsup:760.1-761.51 - rule data.drop {x : idx, z : state}: - `%~>%`(`%;%*`(z, [DATA.DROP_admininstr(x)]), `%;%*`($with_data(z, x, []), [])) + ;; 8-reduction.watsup:10.1-12.34 + rule pure {instr* : instr*, instr'* : instr*, z : state}: + `%~>%`(`%;%*`(z, $admininstr_instr(instr)*{instr}), `%;%*`(z, $admininstr_instr(instr')*{instr'})) + -- Step_pure: `%*~>%*`($admininstr_instr(instr)*{instr}, $admininstr_instr(instr')*{instr'}) ;; 8-reduction.watsup:8.1-8.63 rec { ;; 8-reduction.watsup:8.1-8.63 relation Steps: `%~>*%`(config, config) - ;; 8-reduction.watsup:18.1-19.36 - rule refl {admininstr* : admininstr*, z : state}: - `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) - ;; 8-reduction.watsup:21.1-24.53 rule trans {admininstr* : admininstr*, admininstr' : admininstr, admininstr''* : admininstr*, z : state, z' : state, z'' : state}: `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z'', admininstr''*{admininstr''})) -- Step: `%~>%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z', admininstr'*{})) -- Steps: `%~>*%`(`%;%*`(z', [admininstr']), `%;%*`(z'', admininstr''*{admininstr''})) + + ;; 8-reduction.watsup:18.1-19.36 + rule refl {admininstr* : admininstr*, z : state}: + `%~>*%`(`%;%*`(z, admininstr*{admininstr}), `%;%*`(z, admininstr*{admininstr})) } ;; 8-reduction.watsup:29.1-29.69 @@ -29092,14 +29235,14 @@ rec { ;; 9-module.watsup:7.1-7.34 def alloctypes : type* -> deftype* - ;; 9-module.watsup:8.1-8.27 - def alloctypes([]) = [] ;; 9-module.watsup:9.1-13.24 def {deftype* : deftype*, deftype'* : deftype*, rectype : rectype, type : type, type'* : type*, x : idx} alloctypes(type'*{type'} :: [type]) = deftype'*{deftype'} :: deftype*{deftype} -- if (deftype'*{deftype'} = $alloctypes(type'*{type'})) -- if (type = TYPE(rectype)) -- if (deftype*{deftype} = $subst_all_deftypes($rolldt(x, rectype), $heaptype_deftype(deftype')*{deftype'})) -- if (x = |deftype'*{deftype'}|) + ;; 9-module.watsup:8.1-8.27 + def alloctypes([]) = [] } ;; 9-module.watsup:15.1-15.60 @@ -29114,12 +29257,12 @@ rec { ;; 9-module.watsup:20.1-20.63 def allocfuncs : (store, moduleinst, func*) -> (store, funcaddr*) - ;; 9-module.watsup:21.1-21.39 - def {mm : moduleinst, s : store} allocfuncs(s, mm, []) = (s, []) ;; 9-module.watsup:22.1-24.51 def {fa : funcaddr, fa'* : funcaddr*, func : func, func'* : func*, mm : moduleinst, s : store, s_1 : store, s_2 : store} allocfuncs(s, mm, [func] :: func'*{func'}) = (s_2, [fa] :: fa'*{fa'}) -- if ((s_1, fa) = $allocfunc(s, mm, func)) -- if ((s_2, fa'*{fa'}) = $allocfuncs(s_1, mm, func'*{func'})) + ;; 9-module.watsup:21.1-21.39 + def {mm : moduleinst, s : store} allocfuncs(s, mm, []) = (s, []) } ;; 9-module.watsup:26.1-26.63 @@ -29133,12 +29276,12 @@ rec { ;; 9-module.watsup:30.1-30.67 def allocglobals : (store, globaltype*, val*) -> (store, globaladdr*) - ;; 9-module.watsup:31.1-31.42 - def {s : store} allocglobals(s, [], []) = (s, []) ;; 9-module.watsup:32.1-34.62 def {ga : globaladdr, ga'* : globaladdr*, globaltype : globaltype, globaltype'* : globaltype*, s : store, s_1 : store, s_2 : store, val : val, val'* : val*} allocglobals(s, [globaltype] :: globaltype'*{globaltype'}, [val] :: val'*{val'}) = (s_2, [ga] :: ga'*{ga'}) -- if ((s_1, ga) = $allocglobal(s, globaltype, val)) -- if ((s_2, ga'*{ga'}) = $allocglobals(s_1, globaltype'*{globaltype'}, val'*{val'})) + ;; 9-module.watsup:31.1-31.42 + def {s : store} allocglobals(s, [], []) = (s, []) } ;; 9-module.watsup:36.1-36.60 @@ -29152,12 +29295,12 @@ rec { ;; 9-module.watsup:40.1-40.64 def alloctables : (store, tabletype*, ref*) -> (store, tableaddr*) - ;; 9-module.watsup:41.1-41.41 - def {s : store} alloctables(s, [], []) = (s, []) ;; 9-module.watsup:42.1-44.60 def {ref : ref, ref'* : ref*, s : store, s_1 : store, s_2 : store, ta : tableaddr, ta'* : tableaddr*, tabletype : tabletype, tabletype'* : tabletype*} alloctables(s, [tabletype] :: tabletype'*{tabletype'}, [ref] :: ref'*{ref'}) = (s_2, [ta] :: ta'*{ta'}) -- if ((s_1, ta) = $alloctable(s, tabletype, ref)) -- if ((s_2, ta'*{ta'}) = $alloctables(s_1, tabletype'*{tabletype'}, ref'*{ref'})) + ;; 9-module.watsup:41.1-41.41 + def {s : store} alloctables(s, [], []) = (s, []) } ;; 9-module.watsup:46.1-46.49 @@ -29171,12 +29314,12 @@ rec { ;; 9-module.watsup:50.1-50.52 def allocmems : (store, memtype*) -> (store, memaddr*) - ;; 9-module.watsup:51.1-51.34 - def {s : store} allocmems(s, []) = (s, []) ;; 9-module.watsup:52.1-54.49 def {ma : memaddr, ma'* : memaddr*, memtype : memtype, memtype'* : memtype*, s : store, s_1 : store, s_2 : store} allocmems(s, [memtype] :: memtype'*{memtype'}) = (s_2, [ma] :: ma'*{ma'}) -- if ((s_1, ma) = $allocmem(s, memtype)) -- if ((s_2, ma'*{ma'}) = $allocmems(s_1, memtype'*{memtype'})) + ;; 9-module.watsup:51.1-51.34 + def {s : store} allocmems(s, []) = (s, []) } ;; 9-module.watsup:56.1-56.57 @@ -29190,12 +29333,12 @@ rec { ;; 9-module.watsup:60.1-60.63 def allocelems : (store, reftype*, ref**) -> (store, elemaddr*) - ;; 9-module.watsup:61.1-61.40 - def {s : store} allocelems(s, [], []) = (s, []) ;; 9-module.watsup:62.1-64.55 def {ea : elemaddr, ea'* : elemaddr*, ref* : ref*, ref'** : ref**, rt : reftype, rt'* : reftype*, s : store, s_1 : store, s_2 : store} allocelems(s, [rt] :: rt'*{rt'}, [ref*{ref}] :: ref'*{ref'}*{ref'}) = (s_2, [ea] :: ea'*{ea'}) -- if ((s_1, ea) = $allocelem(s, rt, ref*{ref})) -- if ((s_2, ea'*{ea'}) = $allocelems(s_2, rt'*{rt'}, ref'*{ref'}*{ref'})) + ;; 9-module.watsup:61.1-61.40 + def {s : store} allocelems(s, [], []) = (s, []) } ;; 9-module.watsup:66.1-66.49 @@ -29209,24 +29352,24 @@ rec { ;; 9-module.watsup:70.1-70.54 def allocdatas : (store, byte**) -> (store, dataaddr*) - ;; 9-module.watsup:71.1-71.35 - def {s : store} allocdatas(s, []) = (s, []) ;; 9-module.watsup:72.1-74.50 def {byte* : byte*, byte'** : byte**, da : dataaddr, da'* : dataaddr*, s : store, s_1 : store, s_2 : store} allocdatas(s, [byte*{byte}] :: byte'*{byte'}*{byte'}) = (s_2, [da] :: da'*{da'}) -- if ((s_1, da) = $allocdata(s, byte*{byte})) -- if ((s_2, da'*{da'}) = $allocdatas(s_1, byte'*{byte'}*{byte'})) + ;; 9-module.watsup:71.1-71.35 + def {s : store} allocdatas(s, []) = (s, []) } ;; 9-module.watsup:79.1-79.83 def instexport : (funcaddr*, globaladdr*, tableaddr*, memaddr*, export) -> exportinst - ;; 9-module.watsup:80.1-80.95 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} - ;; 9-module.watsup:81.1-81.99 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} - ;; 9-module.watsup:82.1-82.97 - def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} ;; 9-module.watsup:83.1-83.93 def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, MEM_externidx(x))) = {NAME name, VALUE MEM_externval(ma*{ma}[x])} + ;; 9-module.watsup:82.1-82.97 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, TABLE_externidx(x))) = {NAME name, VALUE TABLE_externval(ta*{ta}[x])} + ;; 9-module.watsup:81.1-81.99 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, GLOBAL_externidx(x))) = {NAME name, VALUE GLOBAL_externval(ga*{ga}[x])} + ;; 9-module.watsup:80.1-80.95 + def {fa* : funcaddr*, ga* : globaladdr*, ma* : memaddr*, name : name, ta* : tableaddr*, x : idx} instexport(fa*{fa}, ga*{ga}, ta*{ta}, ma*{ma}, EXPORT(name, FUNC_externidx(x))) = {NAME name, VALUE FUNC_externval(fa*{fa}[x])} ;; 9-module.watsup:86.1-86.87 def allocmodule : (store, module, externval*, val*, ref*, ref**) -> (store, moduleinst) @@ -29258,27 +29401,27 @@ rec { ;; 9-module.watsup:134.1-134.38 def concat_instr : instr** -> instr* - ;; 9-module.watsup:135.1-135.29 - def concat_instr([]) = [] ;; 9-module.watsup:136.1-136.74 def {instr* : instr*, instr'** : instr**} concat_instr([instr*{instr}] :: instr'*{instr'}*{instr'}) = instr*{instr} :: $concat_instr(instr'*{instr'}*{instr'}) + ;; 9-module.watsup:135.1-135.29 + def concat_instr([]) = [] } ;; 9-module.watsup:138.1-138.33 def runelem : (elem, idx) -> instr* - ;; 9-module.watsup:139.1-139.52 - def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, PASSIVE_elemmode), y) = [] - ;; 9-module.watsup:140.1-140.62 - def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] ;; 9-module.watsup:141.1-142.77 def {expr* : expr*, instr* : instr*, reftype : reftype, x : idx, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, ACTIVE_elemmode(x, instr*{instr})), y) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, |expr*{expr}|) TABLE.INIT_instr(x, y) ELEM.DROP_instr(y)] + ;; 9-module.watsup:140.1-140.62 + def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, DECLARE_elemmode), y) = [ELEM.DROP_instr(y)] + ;; 9-module.watsup:139.1-139.52 + def {expr* : expr*, reftype : reftype, y : idx} runelem(`ELEM%%*%`(reftype, expr*{expr}, PASSIVE_elemmode), y) = [] ;; 9-module.watsup:144.1-144.33 def rundata : (data, idx) -> instr* - ;; 9-module.watsup:145.1-145.44 - def {byte* : byte*, y : idx} rundata(`DATA%*%`(byte*{byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup:146.1-147.78 def {byte* : byte*, instr* : instr*, x : idx, y : idx} rundata(`DATA%*%`(byte*{byte}, ACTIVE_datamode(x, instr*{instr})), y) = instr*{instr} :: [CONST_instr(I32_numtype, 0) CONST_instr(I32_numtype, |byte*{byte}|) MEMORY.INIT_instr(x, y) DATA.DROP_instr(y)] + ;; 9-module.watsup:145.1-145.44 + def {byte* : byte*, y : idx} rundata(`DATA%*%`(byte*{byte}, PASSIVE_datamode), y) = [] ;; 9-module.watsup:149.1-149.53 def instantiate : (store, module, externval*) -> config @@ -29315,20 +29458,20 @@ rec { ;; A-binary.watsup:47.1-47.24 def utf8 : name -> byte* - ;; A-binary.watsup:48.1-48.44 - def {b : byte, c : c} utf8([c]) = [b] - -- if ((c < 128) /\ (c = b)) - ;; A-binary.watsup:49.1-49.93 - def {b_1 : byte, b_2 : byte, c : c} utf8([c]) = [b_1 b_2] - -- if (((128 <= c) /\ (c < 2048)) /\ (c = (((2 ^ 6) * (b_1 - 192)) + (b_2 - 128)))) - ;; A-binary.watsup:50.1-50.144 - def {b_1 : byte, b_2 : byte, b_3 : byte, c : c} utf8([c]) = [b_1 b_2 b_3] - -- if ((((2048 <= c) /\ (c < 55296)) \/ ((57344 <= c) /\ (c < 65536))) /\ (c = ((((2 ^ 12) * (b_1 - 224)) + ((2 ^ 6) * (b_2 - 128))) + (b_3 - 128)))) + ;; A-binary.watsup:52.1-52.41 + def {c* : c*} utf8(c*{c}) = $concat_bytes($utf8([c])*{c}) ;; A-binary.watsup:51.1-51.145 def {b_1 : byte, b_2 : byte, b_3 : byte, b_4 : byte, c : c} utf8([c]) = [b_1 b_2 b_3 b_4] -- if (((65536 <= c) /\ (c < 69632)) /\ (c = (((((2 ^ 18) * (b_1 - 240)) + ((2 ^ 12) * (b_2 - 128))) + ((2 ^ 6) * (b_3 - 128))) + (b_4 - 128)))) - ;; A-binary.watsup:52.1-52.41 - def {c* : c*} utf8(c*{c}) = $concat_bytes($utf8([c])*{c}) + ;; A-binary.watsup:50.1-50.144 + def {b_1 : byte, b_2 : byte, b_3 : byte, c : c} utf8([c]) = [b_1 b_2 b_3] + -- if ((((2048 <= c) /\ (c < 55296)) \/ ((57344 <= c) /\ (c < 65536))) /\ (c = ((((2 ^ 12) * (b_1 - 224)) + ((2 ^ 6) * (b_2 - 128))) + (b_3 - 128)))) + ;; A-binary.watsup:49.1-49.93 + def {b_1 : byte, b_2 : byte, c : c} utf8([c]) = [b_1 b_2] + -- if (((128 <= c) /\ (c < 2048)) /\ (c = (((2 ^ 6) * (b_1 - 192)) + (b_2 - 128)))) + ;; A-binary.watsup:48.1-48.44 + def {b : byte, c : c} utf8([c]) = [b] + -- if ((c < 128) /\ (c = b)) } ;; A-binary.watsup:210.1-210.27 @@ -29342,10 +29485,10 @@ rec { ;; A-binary.watsup:665.1-665.62 def concat_locals : local** -> local* - ;; A-binary.watsup:666.1-666.30 - def concat_locals([]) = [] ;; A-binary.watsup:667.1-667.68 def {loc* : local*, loc'** : local**} concat_locals([loc*{loc}] :: loc'*{loc'}*{loc'}) = loc*{loc} :: $concat_locals(loc'*{loc'}*{loc'}) + ;; A-binary.watsup:666.1-666.30 + def concat_locals([]) = [] } ;; A-binary.watsup:670.1-670.29 diff --git a/spectec/test-prose/TEST.md b/spectec/test-prose/TEST.md index b2c1610581..f0c939f2c4 100644 --- a/spectec/test-prose/TEST.md +++ b/spectec/test-prose/TEST.md @@ -5,59 +5,202 @@ $ (cd ../spec/wasm-3.0 && dune exec ../../src/exe-watsup/main.exe -- *.watsup -v watsup 0.4 generator == Parsing... == Elaboration... +[elab def] def Ki : nat +[elab def] def min(nat, nat) : nat +[elab def] def sum(nat*) : nat +[elab def] def signif(N) : nat +[elab def] def expon(N) : nat +[elab def] def M(N) : nat +[elab def] def E(N) : nat +[elab def] def fzero(N) : fN(N) +[elab def] def setminus(idx*, idx*) : idx* +[elab def] def setminus1(idx, idx*) : idx* +[elab def] def free_dataidx_instr(instr) : dataidx* +[elab def] def free_dataidx_instrs(instr*) : dataidx* +[elab def] def free_dataidx_expr(expr) : dataidx* +[elab def] def free_dataidx_func(func) : dataidx* +[elab def] def free_dataidx_funcs(func*) : dataidx* +[elab def] def concat_bytes((byte*)*) : byte* +[elab def] def size(valtype) : nat +[elab def] def packedsize(packedtype) : nat +[elab def] def storagesize(storagetype) : nat +[elab def] def unpacktype(storagetype) : valtype +[elab def] def unpacknumtype(storagetype) : numtype +[elab def] def sxfield(storagetype) : sx? +[elab def] def diffrt(reftype, reftype) : reftype +[elab def] def idx(typeidx) : typevar +[elab def] def subst_typevar(typevar, typevar*, heaptype*) : heaptype +[elab def] def subst_numtype(numtype, typevar*, heaptype*) : numtype +[elab def] def subst_vectype(vectype, typevar*, heaptype*) : vectype +[elab def] def subst_heaptype(heaptype, typevar*, heaptype*) : heaptype +[elab def] def subst_reftype(reftype, typevar*, heaptype*) : reftype +[elab def] def subst_valtype(valtype, typevar*, heaptype*) : valtype +[elab def] def subst_packedtype(packedtype, typevar*, heaptype*) : packedtype +[elab def] def subst_storagetype(storagetype, typevar*, heaptype*) : storagetype +[elab def] def subst_fieldtype(fieldtype, typevar*, heaptype*) : fieldtype +[elab def] def subst_comptype(comptype, typevar*, heaptype*) : comptype +[elab def] def subst_subtype(subtype, typevar*, heaptype*) : subtype +[elab def] def subst_rectype(rectype, typevar*, heaptype*) : rectype +[elab def] def subst_deftype(deftype, typevar*, heaptype*) : deftype +[elab def] def subst_globaltype(globaltype, typevar*, heaptype*) : globaltype +[elab def] def subst_functype(functype, typevar*, heaptype*) : functype +[elab def] def subst_tabletype(tabletype, typevar*, heaptype*) : tabletype +[elab def] def subst_memtype(memtype, typevar*, heaptype*) : memtype +[elab def] def subst_externtype(externtype, typevar*, heaptype*) : externtype +[elab def] def subst_all_reftype(reftype, heaptype*) : reftype +[elab def] def subst_all_deftype(deftype, heaptype*) : deftype +[elab def] def subst_all_deftypes(deftype*, heaptype*) : deftype* +[elab def] def rollrt(typeidx, rectype) : rectype +[elab def] def unrollrt(rectype) : rectype +[elab def] def rolldt(typeidx, rectype) : deftype* +[elab def] def unrolldt(deftype) : subtype +[elab def] def expanddt(deftype) : comptype +[elab def] def funcsxt(externtype*) : deftype* +[elab def] def globalsxt(externtype*) : globaltype* +[elab def] def tablesxt(externtype*) : tabletype* +[elab def] def memsxt(externtype*) : memtype* +[elab def] def memop0 : memop +[elab def] def s33_to_u32(s33) : u32 +[elab def] def signed(N, nat) : int +[elab def] def invsigned(N, int) : nat +[elab def] def unop(unop_numtype, numtype, c) : c_numtype* +[elab def] def binop(binop_numtype, numtype, c, c) : c_numtype* +[elab def] def testop(testop_numtype, numtype, c) : c_numtype +[elab def] def relop(relop_numtype, numtype, c, c) : c_numtype +[elab def] def cvtop(cvtop, numtype, numtype, sx?, c) : c_numtype* +[elab def] def wrap(nat, nat, c) : nat +[elab def] def ext(nat, nat, sx, c) : c_numtype +[elab def] def ibytes(N, iN(N)) : byte* +[elab def] def fbytes(N, fN(N)) : byte* +[elab def] def ntbytes(numtype, c) : byte* +[elab def] def ztbytes(storagetype, c) : byte* +[elab def] def invibytes(N, byte*) : iN(N) +[elab def] def invfbytes(N, byte*) : fN(N) +[elab def] def inst_reftype(moduleinst, reftype) : reftype +[elab def] def default(valtype) : val? +[elab def] def packval(storagetype, val) : fieldval +[elab def] def unpackval(storagetype, sx?, fieldval) : val +[elab def] def funcsxv(externval*) : funcaddr* +[elab def] def globalsxv(externval*) : globaladdr* +[elab def] def tablesxv(externval*) : tableaddr* +[elab def] def memsxv(externval*) : memaddr* +[elab def] def store(state) : store +[elab def] def frame(state) : frame +[elab def] def funcaddr(state) : funcaddr* +[elab def] def funcinst(state) : funcinst* +[elab def] def globalinst(state) : globalinst* +[elab def] def tableinst(state) : tableinst* +[elab def] def meminst(state) : meminst* +[elab def] def eleminst(state) : eleminst* +[elab def] def datainst(state) : datainst* +[elab def] def structinst(state) : structinst* +[elab def] def arrayinst(state) : arrayinst* +[elab def] def moduleinst(state) : moduleinst +[elab def] def type(state, typeidx) : deftype +[elab def] def func(state, funcidx) : funcinst +[elab def] def global(state, globalidx) : globalinst +[elab def] def table(state, tableidx) : tableinst +[elab def] def mem(state, memidx) : meminst +[elab def] def elem(state, tableidx) : eleminst +[elab def] def data(state, dataidx) : datainst +[elab def] def local(state, localidx) : val? +[elab def] def with_local(state, localidx, val) : state +[elab def] def with_global(state, globalidx, val) : state +[elab def] def with_table(state, tableidx, nat, ref) : state +[elab def] def with_tableinst(state, tableidx, tableinst) : state +[elab def] def with_mem(state, memidx, nat, nat, byte*) : state +[elab def] def with_meminst(state, memidx, meminst) : state +[elab def] def with_elem(state, elemidx, ref*) : state +[elab def] def with_data(state, dataidx, byte*) : state +[elab def] def with_struct(state, structaddr, nat, fieldval) : state +[elab def] def with_array(state, arrayaddr, nat, fieldval) : state +[elab def] def ext_structinst(state, structinst*) : state +[elab def] def ext_arrayinst(state, arrayinst*) : state +[elab def] def growtable(tableinst, nat, ref) : tableinst +[elab def] def growmemory(meminst, nat) : meminst +[elab def] def with_locals(context, localidx*, localtype*) : context +[elab def] def clostype(context, deftype) : deftype +[elab def] def clostypes(deftype*) : deftype* +[elab def] def before(heaptype, typeidx, nat) : bool +[elab def] def unrollht(context, heaptype) : subtype +[elab def] def in_numtype(numtype, numtype*) : bool +[elab def] def in_binop(binop_numtype, ibinop*) : bool +[elab def] def blocktype(state, blocktype) : functype +[elab def] def alloctypes(type*) : deftype* +[elab def] def allocfunc(store, moduleinst, func) : (store, funcaddr) +[elab def] def allocfuncs(store, moduleinst, func*) : (store, funcaddr*) +[elab def] def allocglobal(store, globaltype, val) : (store, globaladdr) +[elab def] def allocglobals(store, globaltype*, val*) : (store, globaladdr*) +[elab def] def alloctable(store, tabletype, ref) : (store, tableaddr) +[elab def] def alloctables(store, tabletype*, ref*) : (store, tableaddr*) +[elab def] def allocmem(store, memtype) : (store, memaddr) +[elab def] def allocmems(store, memtype*) : (store, memaddr*) +[elab def] def allocelem(store, reftype, ref*) : (store, elemaddr) +[elab def] def allocelems(store, reftype*, (ref*)*) : (store, elemaddr*) +[elab def] def allocdata(store, byte*) : (store, dataaddr) +[elab def] def allocdatas(store, (byte*)*) : (store, dataaddr*) +[elab def] def instexport(funcaddr*, globaladdr*, tableaddr*, memaddr*, export) : exportinst +[elab def] def allocmodule(store, module, externval*, val*, ref*, (ref*)*) : (store, moduleinst) +[elab def] def concat_instr((instr*)*) : instr* +[elab def] def runelem(elem, idx) : instr* +[elab def] def rundata(data, idx) : instr* +[elab def] def instantiate(store, module, externval*) : config +[elab def] def invoke(store, funcaddr, val*) : config +[elab def] def utf8(name) : byte* +[elab def] def concat_locals((local*)*) : local* == IL Validation... == Running pass sideconditions... == IL Validation after pass sideconditions... == Running pass animate... Animation failed:if ((ref_1 = REF.NULL_ref(ht_1)) /\ (ref_2 = REF.NULL_ref(ht_2))) -Animation failed:Ref_ok: `%|-%:%`($store(z), ref, rt) -Animation failed:Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) -Animation failed:Ref_ok: `%|-%:%`($store(z), ref, rt) -Animation failed:Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) -Animation failed:Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) -Animation failed:if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) -Animation failed:Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) -Animation failed:Ref_ok: `%|-%:%`($store(z), ref, rt') -Animation failed:Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) -Animation failed:Ref_ok: `%|-%:%`($store(z), ref, rt') -Animation failed:Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) -Animation failed:if (|mut*{mut}| = |zt*{zt}|) -Animation failed:if (|val*{val}| = |zt*{zt}|) -Animation failed:Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) -Animation failed:(if ($default($unpacktype(zt)) = ?(val)))*{val zt} -Animation failed:if (|mut*{mut}| = |zt*{zt}|) -Animation failed:if (i < |zt*{zt}|) -Animation failed:Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) -Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -Animation failed:if ($default($unpacktype(zt)) = ?(val)) -Animation failed:if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) -Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -Animation failed:if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) +Animation failed:if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) +Animation failed:if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : ($size(nt <: valtype) / 8)]) Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) Animation failed:if (nt = $unpacknumtype(zt)) -Animation failed:if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) -Animation failed:Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) +Animation failed:if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) +Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) +Animation failed:if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) Animation failed:Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) Animation failed:if (sx?{sx} = $sxfield(zt_2)) Animation failed:Expand: `%~~%`($type(z, x_2), ARRAY_comptype(`%%`(mut, zt_2))) Animation failed:if (sx?{sx} = $sxfield(zt_2)) -Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -Animation failed:if ((j + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) +Animation failed:Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) Animation failed:if (nt = $unpacknumtype(zt)) -Animation failed:if ($ztbytes(zt, c) = $data(z, y).DATA_datainst[j : ($storagesize(zt) / 8)]) -Animation failed:if ($ntbytes(nt, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : ($size(nt <: valtype) / 8)]) -Animation failed:if ($ibytes(n, c) = $mem(z, x).DATA_meminst[(i + mo.OFFSET_memop) : (n / 8)]) -Animation failed:Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) -Animation failed:if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) +Animation failed:if ($concat_bytes($ztbytes(zt, c)^n{c}) = $data(z, y).DATA_datainst[i : ((n * $storagesize(zt)) / 8)]) +Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) +Animation failed:if ((i + ((n * $storagesize(zt)) / 8)) > |$data(z, y).DATA_datainst|) +Animation failed:if (ref^n{ref} = $elem(z, y).ELEM_eleminst[i : n]) +Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) +Animation failed:if ($default($unpacktype(zt)) = ?(val)) Animation failed:if (|mut*{mut}| = |zt*{zt}|) Animation failed:if (i < |zt*{zt}|) -Animation failed:Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) -Animation failed:if (fv = $packval(zt*{zt}[i], val)) -Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) -Animation failed:if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) +Animation failed:Expand: `%~~%`(si.TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) +Animation failed:if (|mut*{mut}| = |zt*{zt}|) +Animation failed:if (|val*{val}| = |zt*{zt}|) +Animation failed:Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)*{mut zt})) +Animation failed:(if ($default($unpacktype(zt)) = ?(val)))*{val zt} +Animation failed:Ref_ok: `%|-%:%`($store(z), ref, rt') +Animation failed:Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) +Animation failed:Ref_ok: `%|-%:%`($store(z), ref, rt') +Animation failed:Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt', $inst_reftype($moduleinst(z), rt)) +Animation failed:Expand: `%~~%`($funcinst(z)[a].TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) +Animation failed:Expand: `%~~%`(fi.TYPE_funcinst, FUNC_comptype(`%->%`(t_1^n{t_1}, t_2^m{t_2}))) +Animation failed:if (f = {LOCAL ?(val)^n{val} :: $default(t)*{t}, MODULE fi.MODULE_funcinst}) +Animation failed:Ref_ok: `%|-%:%`($store(z), ref, rt) +Animation failed:Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) +Animation failed:Ref_ok: `%|-%:%`($store(z), ref, rt) +Animation failed:Reftype_sub: `%|-%<:%`({TYPE [], REC [], FUNC [], GLOBAL [], TABLE [], MEM [], ELEM [], DATA [], LOCAL [], LABEL [], RETURN ?()}, rt, $inst_reftype($moduleinst(z), rt_2)) Animation failed:Expand: `%~~%`($arrayinst(z)[a].TYPE_arrayinst, ARRAY_comptype(`%%`(mut, zt))) Animation failed:if (fv = $packval(zt, val)) +Animation failed:Expand: `%~~%`($type(z, x), ARRAY_comptype(`%%`(mut, zt))) +Animation failed:if (ai = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val}}) +Animation failed:if (|mut*{mut}| = |zt*{zt}|) +Animation failed:if (i < |zt*{zt}|) +Animation failed:Expand: `%~~%`($structinst(z)[a].TYPE_structinst, STRUCT_comptype(`%%`(mut, zt)*{mut zt})) +Animation failed:if (fv = $packval(zt*{zt}[i], val)) +Animation failed:Expand: `%~~%`($type(z, x), STRUCT_comptype(`%%`(mut, zt)^n{mut zt})) +Animation failed:if (si = {TYPE $type(z, x), FIELD $packval(zt, val)^n{val zt}}) == IL Validation after pass animate... == Prose Generation... == Complete.